File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type
esql/src/main/java/org/elasticsearch/xpack/esql/analysis Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments