-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Day_Of_Month Function As An Alias Of DayOfMonth #194
Add Day_Of_Month Function As An Alias Of DayOfMonth #194
Conversation
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Codecov Report
@@ Coverage Diff @@
## integ-add-day_of_month-function-alt #194 +/- ##
======================================================================
Coverage ? 95.83%
Complexity ? 3544
======================================================================
Files ? 356
Lines ? 9402
Branches ? 674
======================================================================
Hits ? 9010
Misses ? 334
Partials ? 58
Flags with carried forward coverage won't be shown. Click here to find out more. 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
); | ||
} | ||
|
||
public void testInvalidDayOfMonth(String date) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 878a6a1
@@ -430,6 +430,64 @@ public void dayOfMonth() { | |||
assertEquals(integerValue(8), eval(expression)); | |||
} | |||
|
|||
public void testDayOfMonthWithUnderscores(FunctionExpression dateExpression, int dayOfMonth) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 878a6a1
docs/user/dql/functions.rst
Outdated
Description | ||
>>>>>>>>>>> | ||
|
||
Usage: day_of_month(date) extracts the day of the month for date, in the range 1 to 31. The dates with value 0 such as '0000-00-00' or '2008-00-00' are invalid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This seems obvious, but I see that it was included in the synonym functions...
If you'd like, we could remove it from all of the functions.
The dates with value 0 such as '0000-00-00' or '2008-00-00' are invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it's kind of obvious. I will remove it for now and in my PR upstream just add it back in if Amazon wants it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 878a6a1
docs/user/dql/functions.rst
Outdated
| 26 | | ||
+------------------------------+ | ||
|
||
os> SELECT DAY_OF_MONTH(DATE('2020-08-26')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all of these similar tests are covered by IT tests. We can just have the one example in the documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 878a6a1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small fix
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Addressed in 878a6a1 |
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunction.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunction.java
Show resolved
Hide resolved
core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunction.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/opensearch/sql/expression/datetime/DateTimeFunctionTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Added Implementation And Testing For Day_Of_Month Function Signed-off-by: GabeFernandez310 <gabrielf@bitquilltech.com>
Description
Adds support for the
day_of_month
function as an alias for thedayofmonth
function which currently exists in opensearchIssues Resolved
#722
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.