Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into issues/2826
Browse files Browse the repository at this point in the history
  • Loading branch information
LantaoJin committed Jan 9, 2025
2 parents 69baa3d + 0e4acd3 commit c1d7029
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 15 deletions.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/request_of_comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: 📄 Request of comments
about: Create a request of comments to initiate an discussion on feature implementation / design.
title: '[RFC]'
labels: 'rfc, untriaged'
assignees: ''
---

**Problem Statement**
Describes the issue or challenge that needs to be addressed.

**Current State**
Explains the existing setup or context and its shortcomings.

**Long-Term Goals**
* Describe the ideal outcome or future state you aim to achieve.
* What are the primary objectives of this solution should fulfill in the long run?
* How will this solution ensure sustainability or scalability over time?
* Consider whether the solution addresses the root problem and aligns with the overall goals.
* How confident are we that this solution solves the problem?

**Proposal**
Summarizes the suggested solution or improvement.

**Approach**
Details the steps or strategy to implement the proposal.

**Alternative**
Alternative that can serve as workarounds to partially or temporarily solve the problem.

**Implementation Discussion**
Outlines point the discussion regarding the proposed implementation.
4 changes: 2 additions & 2 deletions .github/workflows/sql-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Build with Gradle
run: |
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./gradlew --continue build"
su `id -un 1000` -c "./gradlew --continue --parallel build"
- name: Create Artifact Path
run: |
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
java-version: ${{ matrix.entry.java }}

- name: Build with Gradle
run: ./gradlew --continue build ${{ matrix.entry.os_build_args }}
run: ./gradlew --continue --parallel build ${{ matrix.entry.os_build_args }}

- name: Create Artifact Path
run: |
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
| Peter Fitzgibbons | [pjfitzgibbons](https://github.com/pjfitzgibbons) | Amazon |
| Simeon Widdis | [swiddis](https://github.com/swiddis) | Amazon |
| Chen Dai | [dai-chen](https://github.com/dai-chen) | Amazon |
| Vamsi Manohar | [vmmusings](https://github.com/vmmusings) | Amazon |
| Vamsi Manohar | [vamsimanohar](https://github.com/vamsimanohar) | Amazon |
| Peng Huo | [penghuo](https://github.com/penghuo) | Amazon |
| Sean Kao | [seankao-az](https://github.com/seankao-az) | Amazon |
| Anirudha Jadhav | [anirudha](https://github.com/anirudha) | Amazon |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,23 @@ private void datePartWithTimeArgQuery(String part, String time, long expected) {

@Test
public void testExtractDatePartWithTimeType() {
datePartWithTimeArgQuery(
"DAY", timeInput, LocalDate.now(functionProperties.getQueryStartClock()).getDayOfMonth());
LocalDate now = LocalDate.now(functionProperties.getQueryStartClock());

datePartWithTimeArgQuery(
"WEEK",
timeInput,
LocalDate.now(functionProperties.getQueryStartClock()).get(ALIGNED_WEEK_OF_YEAR));
datePartWithTimeArgQuery("DAY", timeInput, now.getDayOfMonth());

datePartWithTimeArgQuery(
"MONTH", timeInput, LocalDate.now(functionProperties.getQueryStartClock()).getMonthValue());
// To avoid flaky test, skip the testing in December and January because the WEEK is ISO 8601
// week-of-week-based-year which is considered to start on a Monday and week 1 is the first week
// with >3 days. it is possible for early-January dates to be part of the 52nd or 53rd week of
// the previous year, and for late-December dates to be part of the first week of the next year.
// For example, 2005-01-02 is part of the 53rd week of year 2004, while 2012-12-31 is part of
// the first week of 2013
if (now.getMonthValue() != 1 && now.getMonthValue() != 12) {
datePartWithTimeArgQuery("WEEK", datetimeInput, now.get(ALIGNED_WEEK_OF_YEAR));
}

datePartWithTimeArgQuery(
"YEAR", timeInput, LocalDate.now(functionProperties.getQueryStartClock()).getYear());
datePartWithTimeArgQuery("MONTH", timeInput, now.getMonthValue());

datePartWithTimeArgQuery("YEAR", timeInput, now.getYear());
}

@ParameterizedTest(name = "{0}")
Expand Down
8 changes: 6 additions & 2 deletions docs/user/dql/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1944,11 +1944,11 @@ The format specifiers found in this table are the same as those found in the `DA
* - DAY
- %d
* - WEEK
- %X
- %v
* - MONTH
- %m
* - YEAR
- %V
- %Y
* - SECOND_MICROSECOND
- %s%f
* - MINUTE_MICROSECOND
Expand Down Expand Up @@ -1984,6 +1984,10 @@ Example::
| 202302 |
+------------------------------------------------+

Notice:

Function `extract(WEEK FROM ...)` returns the number of the ISO 8601 week-of-week-based-year. ISO week-numbering is considered to start on a Monday and week 1 is the first week with >3 days. In the ISO week-numbering system, it is possible for early-January dates to be part of the 52nd or 53rd week of the previous year, and for late-December dates to be part of the first week of the next year. For example, 2005-01-02 is part of the 53rd week of year 2004, while 2012-12-31 is part of the first week of 2013. Ref https://en.wikipedia.org/wiki/ISO_week_date


FROM_DAYS
---------
Expand Down

0 comments on commit c1d7029

Please sign in to comment.