Skip to content

Commit d1aa099

Browse files
committed
Cover range(DATE)->DATETIME case
1 parent 7cd46a0 commit d1aa099

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,13 @@ public DataType noText() {
588588
return isString(this) ? KEYWORD : this;
589589
}
590590

591+
public boolean isDate() {
592+
return switch (this) {
593+
case DATETIME, DATE_NANOS -> true;
594+
default -> false;
595+
};
596+
}
597+
591598
/**
592599
* Named parameters with default values. It's just easier to do this with
593600
* a builder in java....

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/EnrichLookupService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ private static boolean rangeTypesCompatible(RangeType rangeType, DataType inputD
107107
return switch (rangeType) {
108108
case INTEGER, LONG -> inputDataType.isWholeNumber();
109109
case IP -> inputDataType == DataType.IP;
110+
case DATE -> inputDataType.isDate();
110111
default -> rangeType.isNumeric() == inputDataType.isNumeric();
111112
};
112113
}

0 commit comments

Comments
 (0)