Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
a8467fc
Basic support for DATE_RANGE field type in ESQL
shmuelhanoch Aug 21, 2025
ac9eaa2
[CI] Update transport version definitions
Oct 8, 2025
b5cd87f
Update docs/changelog/133309.yaml
shmuelhanoch Oct 8, 2025
1c0b353
Suppres two more tests
shmuelhanoch Oct 9, 2025
8b6d47c
Two more tests fixes
shmuelhanoch Oct 9, 2025
053f0cb
Two more tests
shmuelhanoch Oct 10, 2025
4d4bf61
Some more infra for new tests
shmuelhanoch Oct 10, 2025
720dd36
Some more fixes for tests
shmuelhanoch Oct 11, 2025
5dc672b
And some more tests
shmuelhanoch Oct 11, 2025
3231b83
And some more tests
shmuelhanoch Oct 13, 2025
84f8a6d
Fix capanility check in CSV tests and some more fixes
shmuelhanoch Oct 13, 2025
983b2c9
Block lookup join
shmuelhanoch Oct 13, 2025
1fbac8e
Block lookup join
shmuelhanoch Oct 15, 2025
5791f06
Relaxed the previous transport version check, which was in fact alway…
shmuelhanoch Oct 20, 2025
cde8323
Fixed a typo
shmuelhanoch Oct 20, 2025
8bb26b2
Style fixes
shmuelhanoch Oct 20, 2025
4937985
More fixes: block lookup join. Delete date_range from unsupported yam…
shmuelhanoch Oct 20, 2025
ab1506e
Supress RestEsqlIT because complex queries like this are not supporte…
shmuelhanoch Oct 21, 2025
879d71f
Merge remote-tracking branch 'origin/main' into esql_date_range_data_…
craigtaverner Oct 21, 2025
83e5571
Removed unused field
craigtaverner Oct 21, 2025
fea50ba
Bring back deleted yaml tests
craigtaverner Oct 21, 2025
156754e
Refactor DateRange Block type (and element type) to LongRange
craigtaverner Oct 22, 2025
4e77c92
Review fixes
shmuelhanoch Oct 23, 2025
ed01a9d
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Oct 23, 2025
ed04e57
small fixes
shmuelhanoch Oct 23, 2025
d1eb012
Added identity option to TO_DATE_RANGE, plus more tests
craigtaverner Oct 23, 2025
0b5926b
Merge branch 'main' into esql_date_range_data_type
craigtaverner Oct 23, 2025
95d061c
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Oct 26, 2025
9ec1055
[CI] Update transport version definitions
Oct 26, 2025
547fcfa
Fix irregular spaces (#137014)
theletterf Oct 25, 2025
37f1349
Test utility for `POST _features/_reset` (#137133)
DaveCTurner Oct 25, 2025
3ad8726
Revert "Test utility for `POST _features/_reset` (#137133)"
DaveCTurner Oct 25, 2025
52285cd
Mute org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT test {csv-…
elasticsearchmachine Oct 25, 2025
0ef554e
Mute org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT test {csv…
elasticsearchmachine Oct 25, 2025
496f7bc
Mute org.elasticsearch.xpack.esql.qa.single_node.GenerativeForkIT tes…
elasticsearchmachine Oct 25, 2025
c81e076
Mute org.elasticsearch.cluster.routing.allocation.decider.WriteLoadCo…
elasticsearchmachine Oct 25, 2025
1c72c2c
Try bulk load sorted ordinals across ranges (#137076)
dnhatn Oct 26, 2025
e48b8c8
Fix serialization assymetry (writeOptional vs plain read), fixed Veri…
shmuelhanoch Oct 26, 2025
30ced99
Relax (again) the check in blockLoader in RangeFieldMapper, since it …
shmuelhanoch Oct 26, 2025
28b856f
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Oct 26, 2025
487a593
[CI] Auto commit changes from spotless
Oct 26, 2025
131ed34
AnalyzerTest fix
shmuelhanoch Oct 27, 2025
1954260
Fix APM tracer to respect recording status of spans (#137015)
mosche Oct 26, 2025
2669505
Mute org.elasticsearch.xpack.esql.plan.logical.CommandLicenseTests te…
elasticsearchmachine Oct 26, 2025
4940de5
Catch-and-rethrow TooComplexToDeterminizeException within ESQL (#137024)
MattAlp Oct 26, 2025
077ef04
[ES|QL] Non-Correlated Subquery in FROM command (#135744)
fang-xing-esql Oct 27, 2025
3862723
[docs] Update category field to use keyword type in full text tutoria…
leemthompo Oct 27, 2025
19c78d4
[Inference API] Rename E5 model/inference endpoint in EIS to JinaAI c…
timgrein Oct 27, 2025
2304569
ESQL: Add a bit of javadoc to preanalysis methods (#137099)
alex-spies Oct 27, 2025
2a7a4f6
Adds ml-cpp release notes (#137178)
kosabogi Oct 27, 2025
c8d7df1
Remove mutes pointing to closed ESQL flaky test issues (#137174)
idegtiarenko Oct 27, 2025
16eb6a1
rest-api-spec: Add missing options to enum types (#136640)
pquentin Oct 27, 2025
b431e61
Add applies_to frontmatter to mapping-reference docs (#137184)
leemthompo Oct 27, 2025
659067c
[docs] Update ESQL command H1 titles for SEO (#137188)
leemthompo Oct 27, 2025
1a36f1d
style fix
shmuelhanoch Oct 27, 2025
fd007e4
Some fixes: change the TopNEncoder to the correct one, fix the unsupp…
shmuelhanoch Oct 28, 2025
0e000ab
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Oct 28, 2025
47fa01b
Transport version
shmuelhanoch Oct 28, 2025
fc657c6
[CI] Auto commit changes from spotless
Oct 28, 2025
b8961d1
Remove temporary print
shmuelhanoch Oct 28, 2025
c657385
Add missing fix in boolean tranport flag in IndexResolver
shmuelhanoch Oct 28, 2025
6d7d5d1
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Oct 28, 2025
71ac3dd
Serialize "unsupported" DataType when communicating to old clusters
craigtaverner Oct 29, 2025
c445c61
Merge branch 'esql_date_range_data_type' of github.com:shmuelhanoch/e…
craigtaverner Oct 29, 2025
eab89c6
Block date_range on yaml tests for bwc
craigtaverner Oct 29, 2025
06e959c
Merge remote-tracking branch 'origin/main' into esql_date_range_data_…
craigtaverner Oct 29, 2025
be0c506
Fixed missing import after resolving conflicts with main
craigtaverner Oct 29, 2025
24768ec
Fix mistake on merging main with new element types
craigtaverner Oct 29, 2025
9cf00b0
Revert fix to DataType serialization
craigtaverner Oct 29, 2025
e9a24e4
Try a temporary fix for enrichment
shmuelhanoch Oct 29, 2025
a20c68a
[CI] Auto commit changes from spotless
Oct 29, 2025
d32e5ec
Some small fixes
shmuelhanoch Oct 29, 2025
e23f909
cat API: added endpoint for Circuit Breakers (#136890)
mamazzol Oct 29, 2025
af31b71
ESQL: Fix release tests (#137298)
nik9000 Oct 29, 2025
787751a
Reject invalid `reverse_nested` aggs (#137047)
MattAlp Oct 29, 2025
1b81144
Mute org.elasticsearch.xpack.esql.plan.physical.ShowExecSerialization…
elasticsearchmachine Oct 29, 2025
9a92f47
Mute org.elasticsearch.readiness.ReadinessClusterIT testReadinessDuri…
elasticsearchmachine Oct 29, 2025
73dc3a5
[docs] Update changelog summary for semantic_text ELSER on EIS defaul…
leemthompo Oct 29, 2025
afe81de
Fix method visibility in public-callers-finder (#137200)
mosche Oct 29, 2025
eefe858
[ML] Adding bulk create functionality to ModelRegistry (#136569)
jonathan-buttner Oct 29, 2025
4fe26b6
Remove deprecated constant for default elser inference id (#137329)
mridula-s109 Oct 29, 2025
bb96d8d
ESQL: Handle release of 9.2 in test (#137070)
nik9000 Oct 29, 2025
a9fe602
Fixed inconsistency in the isSyntheticSourceEnabled flag (#137297)
Kubik42 Oct 29, 2025
e348b4f
[ML] Disable CPS for Dataframes (#136716)
prwhelan Oct 29, 2025
73bf119
[Docs] Improve semantic_text updates documentation organization (#137…
mridula-s109 Oct 29, 2025
2a3a101
Remove unused field from IndexModule (#137342)
romseygeek Oct 29, 2025
3643b7d
Improving random sampling performance by lazily calling getSamplingCo…
masseyke Oct 29, 2025
4d18f25
[ML] Disable CrossProject for Datafeeds (#136897)
prwhelan Oct 29, 2025
769b8b4
[ES-12998] Invoking gradle continue flag on periodic runs to allow fo…
neilbhavsar Oct 29, 2025
2a8d7e4
ES|QL: Improve value loading for match_only_text mapping (#137026)
ioanatia Oct 29, 2025
ec3a575
[Transform] Remove extra reset calls (#137346)
prwhelan Oct 29, 2025
dc603ca
Add chunk_rescorer usage to output of explain and profile for text_si…
kderusso Oct 29, 2025
f3f5cba
Remove `first` and `last` functions from documentation (#137341)
kkrik-es Oct 29, 2025
b452bb1
ESQL: Work around concurrent serialization bug (#137350)
nik9000 Oct 29, 2025
e240b54
[ES|QL] Add CHUNK function (#134320)
kderusso Oct 29, 2025
ce5dc58
Add default sort for message.template_id field in logsdb indices (#13…
jordan-powers Oct 29, 2025
698e0a1
Transport version
shmuelhanoch Oct 29, 2025
d43d554
[CI] Update transport version definitions
Oct 29, 2025
16a1578
Specifically allow to_date_range and to_string
shmuelhanoch Oct 30, 2025
66db920
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Oct 30, 2025
9c242fe
Tansport version
shmuelhanoch Oct 30, 2025
fbe6964
Update docs/changelog/133309.yaml
shmuelhanoch Oct 30, 2025
3500708
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Oct 30, 2025
0b58bc1
Fixed forbidden toString
shmuelhanoch Oct 30, 2025
b9855f2
Revert enrichment hack
shmuelhanoch Oct 30, 2025
1c688eb
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 1, 2025
77dcdf5
transport version
shmuelhanoch Nov 1, 2025
875202f
Fixed accidentally deleted files
shmuelhanoch Nov 1, 2025
b2d3702
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 4, 2025
3a21924
[CI] Update transport version definitions
Nov 4, 2025
96d6aff
Generated files for to_string / is_null tests
shmuelhanoch Nov 4, 2025
819f8a4
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 4, 2025
f522890
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 5, 2025
24e691c
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 7, 2025
c5087e7
Transport version
shmuelhanoch Nov 7, 2025
0dabc02
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 8, 2025
65fe721
[CI] Update transport version definitions
Nov 8, 2025
72bfe07
Transport version
shmuelhanoch Nov 8, 2025
801f6cc
Small merge accident fix
shmuelhanoch Nov 8, 2025
88910d9
Added missing case for BlockTestUtils
shmuelhanoch Nov 8, 2025
d15d3a2
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 8, 2025
08261e4
Small fix for AllSupportedFieldTest
shmuelhanoch Nov 9, 2025
e12d810
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 9, 2025
c89befe
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 10, 2025
fd43f2d
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 10, 2025
e4587b0
Transport version
shmuelhanoch Nov 10, 2025
a1ac3c4
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 10, 2025
a679cc0
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 11, 2025
6823095
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 13, 2025
5cf18e3
[CI] Update transport version definitions
Nov 13, 2025
322c9e5
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 16, 2025
2f5a645
[CI] Update transport version definitions
Nov 17, 2025
f141d3b
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 19, 2025
0f62403
Transport version
shmuelhanoch Nov 19, 2025
1b1cea2
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 24, 2025
680ea4d
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Nov 29, 2025
d178ede
merge fixes
shmuelhanoch Nov 29, 2025
6ce85a9
Merge branch 'main' into esql_date_range_data_type
shmuelhanoch Dec 3, 2025
345b9d8
change date_range to under_construction
shmuelhanoch Dec 3, 2025
a652b6f
Some error tests fixes
shmuelhanoch Dec 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/changelog/133309.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 133309
summary: support DATE_RANGE field type
area: ES|QL
type: "enhancement"
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
| counter_long | boolean |
| date | boolean |
| date_nanos | boolean |
| date_range | boolean |
| dense_vector | boolean |
| double | boolean |
| geo_point | boolean |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
| counter_long | boolean |
| date | boolean |
| date_nanos | boolean |
| date_range | boolean |
| dense_vector | boolean |
| double | boolean |
| geo_point | boolean |
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,8 @@ interface BlockFactory {

AggregateMetricDoubleBuilder aggregateMetricDoubleBuilder(int count);

LongRangeBuilder dateRangeBuilder(int count);

Block buildAggregateMetricDoubleDirect(Block minBlock, Block maxBlock, Block sumBlock, Block countBlock);

ExponentialHistogramBuilder exponentialHistogramBlockBuilder(int count);
Expand Down Expand Up @@ -840,6 +842,12 @@ interface AggregateMetricDoubleBuilder extends Builder {
IntBuilder count();
}

interface LongRangeBuilder extends Builder {
LongBuilder from();

LongBuilder to();
}

interface ExponentialHistogramBuilder extends Builder {
DoubleBuilder minima();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@

package org.elasticsearch.index.mapper;

import org.apache.lucene.index.BinaryDocValues;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.SortField;
import org.apache.lucene.util.BytesRef;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.common.Explicit;
import org.elasticsearch.common.geo.ShapeRelation;
import org.elasticsearch.common.network.InetAddresses;
Expand All @@ -28,6 +31,7 @@
import org.elasticsearch.index.fielddata.IndexFieldData;
import org.elasticsearch.index.fielddata.IndexFieldDataCache;
import org.elasticsearch.index.fielddata.plain.BinaryIndexFieldData;
import org.elasticsearch.index.mapper.blockloader.docvalues.BlockDocValuesReader;
import org.elasticsearch.index.query.SearchExecutionContext;
import org.elasticsearch.indices.breaker.CircuitBreakerService;
import org.elasticsearch.search.DocValueFormat;
Expand Down Expand Up @@ -61,6 +65,8 @@ public class RangeFieldMapper extends FieldMapper {
public static final boolean DEFAULT_INCLUDE_UPPER = true;
public static final boolean DEFAULT_INCLUDE_LOWER = true;

public static final TransportVersion ESQL_LONG_RANGES = TransportVersion.fromName("esql_long_ranges");

public static class Defaults {
public static final DateFormatter DATE_FORMATTER = DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER;
public static final Locale LOCALE = DateFieldMapper.DEFAULT_LOCALE;
Expand Down Expand Up @@ -342,6 +348,97 @@ public Query rangeQuery(
context
);
}

public static class DateRangeDocValuesLoader extends BlockDocValuesReader.DocValuesBlockLoader {
private final String fieldName;

public DateRangeDocValuesLoader(String fieldName) {
this.fieldName = fieldName;
}

@Override
public Builder builder(BlockFactory factory, int expectedCount) {
return factory.dateRangeBuilder(expectedCount);
}

@Override
public AllReader reader(LeafReaderContext context) throws IOException {
var docValues = context.reader().getBinaryDocValues(fieldName);
return new DateRangeDocValuesReader(docValues);
}
}

@Override
public BlockLoader blockLoader(BlockLoaderContext blContext) {
if (rangeType != RangeType.DATE) {
throw new UnsupportedOperationException("loading blocks is only supported for date fields");
}
if (hasDocValues()) {
return new DateRangeDocValuesLoader(name());
}
throw new IllegalStateException("Cannot load blocks without doc values");
}
}

public static class DateRangeDocValuesReader extends BlockDocValuesReader {
private final BinaryDocValues numericDocValues;

public DateRangeDocValuesReader(BinaryDocValues numericDocValues) {
this.numericDocValues = numericDocValues;
}

private int docId = -1;

@Override
protected int docId() {
return docId;
}

@Override
public String toString() {
return "BlockDocValuesReader.DateRangeDocValuesReader";
}

@Override
public BlockLoader.Block read(BlockLoader.BlockFactory factory, BlockLoader.Docs docs, int offset, boolean nullsFiltered)
throws IOException {
try (BlockLoader.LongRangeBuilder builder = factory.dateRangeBuilder(docs.count() - offset)) {
int lastDoc = -1;
for (int i = offset; i < docs.count(); i++) {
int doc = docs.get(i);
if (doc < lastDoc) {
throw new IllegalStateException("docs within same block must be in order");
}
if (false == numericDocValues.advanceExact(doc)) {
builder.appendNull();
} else {
BytesRef ref = numericDocValues.binaryValue();
var ranges = BinaryRangeUtil.decodeLongRanges(ref);
for (var range : ranges) {
lastDoc = doc;
this.docId = doc;
builder.from().appendLong((long) range.from);
builder.to().appendLong((long) range.to);
}
}
}
return builder.build();
}
}

@Override
public void read(int doc, BlockLoader.StoredFields storedFields, BlockLoader.Builder builder) throws IOException {
var blockBuilder = (BlockLoader.LongRangeBuilder) builder;
this.docId = doc;
if (false == numericDocValues.advanceExact(doc)) {
blockBuilder.appendNull();
} else {
var range = BinaryRangeUtil.decodeLongRanges(numericDocValues.binaryValue());
assert range.size() == 1 : "stored fields should only have a single range";
blockBuilder.from().appendLong((long) range.getFirst().from);
blockBuilder.to().appendLong((long) range.getFirst().to);
}
}
}

private final RangeType type;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9232000
2 changes: 1 addition & 1 deletion server/src/main/resources/transport/upper_bounds/9.3.csv
Original file line number Diff line number Diff line change
@@ -1 +1 @@
esql_use_minimum_version_for_enrich_resolution,9231000
esql_long_ranges,9232000
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,11 @@ public BlockLoader.AggregateMetricDoubleBuilder aggregateMetricDoubleBuilder(int
return new AggregateMetricDoubleBlockBuilder(expectedSize);
}

@Override
public BlockLoader.LongRangeBuilder dateRangeBuilder(int expectedSize) {
return new LongRangeBuilder(expectedSize);
}

@Override
public BlockLoader.Block buildAggregateMetricDoubleDirect(
BlockLoader.Block minBlock,
Expand Down Expand Up @@ -901,4 +906,68 @@ public BlockLoader.BytesRefBuilder encodedHistograms() {
return encodedHistograms;
}
}

public static class LongRangeBuilder implements BlockLoader.LongRangeBuilder {
private final LongBuilder from;
private final LongBuilder to;

LongRangeBuilder(int expectedSize) {
from = new LongBuilder(expectedSize);
to = new LongBuilder(expectedSize);
}

@Override
public BlockLoader.LongBuilder from() {
return from;
}

@Override
public BlockLoader.LongBuilder to() {
return to;
}

@Override
public BlockLoader.Block build() {
var fromBlock = from.build();
var toBlock = to.build();
assert fromBlock.size() == toBlock.size();
var values = new ArrayList<>(fromBlock.size());
for (int i = 0; i < fromBlock.size(); i++) {
values.add(List.of(fromBlock.values.get(i), toBlock.values.get(i)));
}
return new TestBlock(values);
}

@Override
public BlockLoader.Builder appendNull() {
throw new UnsupportedOperationException();
}

@Override
public BlockLoader.Builder beginPositionEntry() {
throw new UnsupportedOperationException();
}

@Override
public BlockLoader.Builder endPositionEntry() {
throw new UnsupportedOperationException();
}

@Override
public void close() {

}

private static class LongBuilder extends TestBlock.Builder implements BlockLoader.LongBuilder {
private LongBuilder(int expectedSize) {
super(expectedSize);
}

@Override
public BlockLoader.LongBuilder appendLong(long value) {
add(value);
return this;
}
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static org.elasticsearch.xpack.esql.core.type.DataType.AGGREGATE_METRIC_DOUBLE;
import static org.elasticsearch.xpack.esql.core.type.DataType.BOOLEAN;
import static org.elasticsearch.xpack.esql.core.type.DataType.DATETIME;
import static org.elasticsearch.xpack.esql.core.type.DataType.DATE_RANGE;
import static org.elasticsearch.xpack.esql.core.type.DataType.DENSE_VECTOR;
import static org.elasticsearch.xpack.esql.core.type.DataType.IP;
import static org.elasticsearch.xpack.esql.core.type.DataType.NULL;
Expand Down Expand Up @@ -86,24 +87,24 @@ public static TypeResolution isRepresentableExceptCountersDenseVectorAndAggregat
) {
return isType(
e,
dt -> isRepresentable(dt) && dt != DENSE_VECTOR && dt != AGGREGATE_METRIC_DOUBLE,
dt -> isRepresentable(dt) && dt != DENSE_VECTOR && dt != AGGREGATE_METRIC_DOUBLE && dt != DATE_RANGE,
operationName,
paramOrd,
"any type except counter types, dense_vector, or aggregate_metric_double"
"any type except counter types, dense_vector, aggregate_metric_double or date_range"
);
}

public static TypeResolution isRepresentableExceptCountersSpatialDenseVectorAndAggregateMetricDouble(
Expression e,
String operationName,
ParamOrdinal paramOrd
) {
public static TypeResolution isRepresentableExceptUnsortableTypes(Expression e, String operationName, ParamOrdinal paramOrd) {
return isType(
e,
(t) -> isSpatialOrGrid(t) == false && DataType.isRepresentable(t) && t != DENSE_VECTOR && t != AGGREGATE_METRIC_DOUBLE,
(t) -> isSpatialOrGrid(t) == false
&& DataType.isRepresentable(t)
&& t != DENSE_VECTOR
&& t != AGGREGATE_METRIC_DOUBLE
&& t != DATE_RANGE,
operationName,
paramOrd,
"any type except counter, spatial types, dense_vector, or aggregate_metric_double"
"any type except counter, spatial types, dense_vector, aggregate_metric_double or date_range"
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ public enum DataType implements Writeable {
* Nanosecond precision date, stored as a 64-bit signed number.
*/
DATE_NANOS(builder().esType("date_nanos").estimatedSize(Long.BYTES).docValues().supportedOnAllNodes()),
/**
* Represents a half-inclusive range between two dates.
*/
DATE_RANGE(builder().esType("date_range").estimatedSize(2 * Long.BYTES).docValues().underConstruction()),
/**
* IP addresses. IPv4 address are always
* <a href="https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5">embedded</a>
Expand Down Expand Up @@ -997,5 +1001,6 @@ public static class DataTypesTransportVersions {
public static final TransportVersion ESQL_AGGREGATE_METRIC_DOUBLE_CREATED_VERSION = TransportVersion.fromName(
"esql_aggregate_metric_double_created_version"
);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,28 @@ public final AggregateMetricDoubleBlock newAggregateMetricDoubleBlock(
return new AggregateMetricDoubleArrayBlock(min, max, sum, count);
}

public LongRangeBlockBuilder newLongRangeBlockBuilder(int estimatedSize) {
return new LongRangeBlockBuilder(estimatedSize, this);
}

public LongRangeBlock newConstantLongRangeBlock(LongRangeBlockBuilder.LongRange value, int positions) {
try (var builder = newLongRangeBlockBuilder(positions)) {
for (int i = 0; i < positions; i++) {
if (value.from() == null) {
builder.from().appendNull();
} else {
builder.from().appendLong(value.from());
}
if (value.to() == null) {
builder.to().appendNull();
} else {
builder.to().appendLong(value.to());
}
}
return builder.build();
}
}

/**
* Returns the maximum number of bytes that a Block should be backed by a primitive array before switching to using BigArrays.
*/
Expand Down
Loading
Loading