Skip to content

Commit ca78270

Browse files
committed
Update docs/changelog/133309.yaml
1 parent f145126 commit ca78270

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

docs/changelog/133309.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 133309
2+
summary: support DATE_RANGE field type
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/DateRangeBlock.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ public sealed interface DateRangeBlock extends Block permits DateRangeArrayBlock
3333
* equals method works properly across different implementations of the AggregateMetricDoubleBlock interface.
3434
*/
3535
static boolean equals(DateRangeBlock lhs, DateRangeBlock rhs) {
36-
if (lhs == rhs) return true;
37-
if (lhs.getPositionCount() != rhs.getPositionCount()) return false;
36+
if (lhs == rhs) {
37+
return true;
38+
}
39+
if (lhs.getPositionCount() != rhs.getPositionCount()) {
40+
return false;
41+
}
3842
return LongBlock.equals(lhs.getFromBlock(), rhs.getFromBlock()) && LongBlock.equals(lhs.getToBlock(), rhs.getToBlock());
3943
}
4044

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ private Tuple<ResolvedEnrichPolicy, String> mergeLookupResults(
289289
// field and then added as a first-class ESQL field type. So in enrichment over clusters it may appear as
290290
// DATE_RANGE VS UNSUPPORTED, even though it's still the same type.
291291
private boolean typeMismatch(DataType old, DataType field) {
292-
if (old == DataType.DATE_RANGE && field == DataType.UNSUPPORTED) return false;
292+
if (old == DataType.DATE_RANGE && field == DataType.UNSUPPORTED) {
293+
return false;
294+
}
293295
return old.equals(field) == false;
294296
}
295297

0 commit comments

Comments
 (0)