Skip to content

Commit 913e0fb

Browse files
ESQL Date Nanos Addition and Subtraction (#116839)
Resolves #109995 This adds support and tests for addition and subtraction of date nanos with periods and durations. It does not include support for date_diff, which is a separate ticket (#109999). The bulk of the PR is testing, the actual date math is all handled by library functions. --------- Co-authored-by: Elastic Machine <[email protected]>
1 parent e10fc3c commit 913e0fb

File tree

19 files changed

+1152
-61
lines changed

19 files changed

+1152
-61
lines changed

docs/reference/esql/functions/kibana/definition/add.json

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/esql/functions/kibana/definition/sub.json

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/esql/functions/types/add.asciidoc

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/esql/functions/types/sub.asciidoc

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type/DataType.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,14 @@ public static boolean isDateTimeOrTemporal(DataType t) {
415415
return isDateTime(t) || isTemporalAmount(t);
416416
}
417417

418+
public static boolean isDateTimeOrNanosOrTemporal(DataType t) {
419+
return isDateTime(t) || isTemporalAmount(t) || t == DATE_NANOS;
420+
}
421+
422+
public static boolean isMillisOrNanos(DataType t) {
423+
return t == DATETIME || t == DATE_NANOS;
424+
}
425+
418426
public static boolean areCompatible(DataType left, DataType right) {
419427
if (left == right) {
420428
return true;

0 commit comments

Comments
 (0)