-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Esql Support date nanos on date diff function #120645
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
Changes from 9 commits
e6c3c1f
2966244
466624a
5dc21c5
f46f586
a29e482
7c450c6
09c1c08
1c2e31a
e409072
1a6fd42
353ba15
1ba57e1
b35262c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 120645 | ||
summary: Esql Support date nanos on date diff function | ||
area: ES|QL | ||
type: enhancement | ||
issues: | ||
- 109999 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1249,3 +1249,26 @@ sv_nanos:date_nanos | a:keyword | b:keyword | c:keywo | |
2023-03-23T12:15:03.360103847Z | 2023-03-23T12:15:03.360Z | 2023-03-23 | 2023-03-23T12:15:03.360103847Z | ||
2023-03-23T12:15:03.360103847Z | 2023-03-23T12:15:03.360Z | 2023-03-23 | 2023-03-23T12:15:03.360103847Z | ||
; | ||
|
||
Date Nanos Date Diff | ||
required_capability: date_nanos_date_diff | ||
required_capability: to_date_nanos | ||
|
||
FROM date_nanos | ||
| EVAL n = MV_MAX(nanos) | ||
| EVAL diff_sec = DATE_DIFF("seconds", TO_DATE_NANOS("2023-10-23T12:15:03.360103847Z"), n) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, maybe another test with the first param coming from an index, as we don't test it here. From an index, or from a CASE(). Whatever, as long as it's not a constant |
||
| KEEP diff_sec, n; | ||
ignoreOrder:true | ||
|
||
diff_sec:integer | n:date_nanos | ||
5998 | 2023-10-23T13:55:01.543123456Z | ||
5932 | 2023-10-23T13:53:55.832987654Z | ||
5871 | 2023-10-23T13:52:55.015787878Z | ||
5811 | 2023-10-23T13:51:54.732102837Z | ||
4711 | 2023-10-23T13:33:34.937193000Z | ||
745 | 2023-10-23T12:27:28.948000000Z | ||
0 | 2023-10-23T12:15:03.360103847Z | ||
0 | 2023-10-23T12:15:03.360103847Z | ||
-18489600 | 2023-03-23T12:15:03.360103847Z | ||
-18489600 | 2023-03-23T12:15:03.360103847Z | ||
; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Should we add two extra cases for the combinations of millis and nanos? Maybe in this same test, as extra columns
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've added one such.