File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
qa/testFixtures/src/main/resources
src/main/java/org/elasticsearch/xpack/esql/action Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -1249,3 +1249,26 @@ sv_nanos:date_nanos | a:keyword | b:keyword | c:keywo
124912492023-03-23T12:15:03.360103847Z | 2023-03-23T12:15:03.360Z | 2023-03-23 | 2023-03-23T12:15:03.360103847Z
125012502023-03-23T12:15:03.360103847Z | 2023-03-23T12:15:03.360Z | 2023-03-23 | 2023-03-23T12:15:03.360103847Z
12511251;
1252+
1253+ Date Nanos Date Diff
1254+ required_capability: date_nanos_date_diff
1255+ required_capability: to_date_nanos
1256+
1257+ FROM date_nanos
1258+ | EVAL n = MV_MAX(nanos)
1259+ | EVAL diff_sec = DATE_DIFF("seconds", TO_DATE_NANOS("2023-10-23T12:15:03.360103847Z"), n)
1260+ | KEEP diff_sec, n;
1261+ ignoreOrder:true
1262+
1263+ diff_sec:integer | n:date_nanos
1264+ 5998 | 2023-10-23T13:55:01.543123456Z
1265+ 5932 | 2023-10-23T13:53:55.832987654Z
1266+ 5871 | 2023-10-23T13:52:55.015787878Z
1267+ 5811 | 2023-10-23T13:51:54.732102837Z
1268+ 4711 | 2023-10-23T13:33:34.937193000Z
1269+ 745 | 2023-10-23T12:27:28.948000000Z
1270+ 0 | 2023-10-23T12:15:03.360103847Z
1271+ 0 | 2023-10-23T12:15:03.360103847Z
1272+ -18489600 | 2023-03-23T12:15:03.360103847Z
1273+ -18489600 | 2023-03-23T12:15:03.360103847Z
1274+ ;
Original file line number Diff line number Diff line change @@ -503,7 +503,10 @@ public enum Cap {
503503 * Support running date format function on nanosecond dates
504504 */
505505 DATE_NANOS_DATE_FORMAT (),
506-
506+ /**
507+ * support date diff function on date nanos type, and mixed nanos/millis
508+ */
509+ DATE_NANOS_DATE_DIFF (),
507510 /**
508511 * DATE_PARSE supports reading timezones
509512 */
You can’t perform that action at this time.
0 commit comments