Skip to content

Commit 5791f06

Browse files
committed
Relaxed the previous transport version check, which was in fact always false - replace it with something that can work for now.
1 parent 1fbac8e commit 5791f06

File tree

2 files changed

+9
-1
lines changed
  • x-pack/plugin
    • esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type
    • esql/src/main/java/org/elasticsearch/xpack/esql/analysis

2 files changed

+9
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ public enum DataType implements Writeable {
271271
* Nanosecond precision date, stored as a 64-bit signed number.
272272
*/
273273
DATE_NANOS(builder().esType("date_nanos").estimatedSize(Long.BYTES).docValues().supportedOnAllNodes()),
274+
/**
275+
* Represents a half-inclusive range between two dates.
276+
*/
274277
DATE_RANGE(builder().esType("date_range").estimatedSize(2 * Long.BYTES).docValues().supportedOn(ESQL_DATE_RANGE_CREATED_VERSION)),
275278
/**
276279
* IP addresses. IPv4 address are always

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/PreAnalyzer.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ protected PreAnalysis doPreAnalyze(LogicalPlan plan) {
8888
supportsAggregateMetricDouble.set(true);
8989
}
9090
}));
91-
91+
// This is a temporary solution for the first phase of date_range: ATM we don't support any functions
92+
// on date_range, but we do want to allow the simplest possible cases of loading and rendering those fields.
93+
// Not the most useful idea but it is a (relatively) safe way to add it without breaking tests.
94+
if (plan.expressions().isEmpty()) {
95+
supportsDateRange.set(true);
96+
}
9297
// mark plan as preAnalyzed (if it were marked, there would be no analysis)
9398
plan.forEachUp(LogicalPlan::setPreAnalyzed);
9499

0 commit comments

Comments
 (0)