Skip to content

Commit a0eaf7b

Browse files
committed
Merge branch 'main' into feature/esql-match-options
# Conflicts: # docs/reference/esql/functions/kibana/definition/match_operator.json # docs/reference/esql/functions/kibana/docs/match_operator.md # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext/Match.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/ExpressionBuilder.java # x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractFunctionTestCase.java # x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchOperatorTests.java # x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchTests.java
2 parents c2f4ff6 + f61f139 commit a0eaf7b

File tree

295 files changed

+9393
-2722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+9393
-2722
lines changed
Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
config:
22
allow-labels: test-release
33
steps:
4-
- label: release-tests
5-
command: .buildkite/scripts/release-tests.sh
6-
timeout_in_minutes: 300
7-
agents:
8-
provider: gcp
9-
image: family/elasticsearch-ubuntu-2004
10-
diskSizeGb: 350
11-
machineType: custom-32-98304
4+
- group: release-tests
5+
steps:
6+
- label: "{{matrix.CHECK_TASK}} / release-tests"
7+
key: "packaging-tests-unix"
8+
command: .buildkite/scripts/release-tests.sh {{matrix.CHECK_TASK}}
9+
timeout_in_minutes: 120
10+
matrix:
11+
setup:
12+
CHECK_TASK:
13+
- checkPart1
14+
- checkPart2
15+
- checkPart3
16+
- checkPart4
17+
- checkPart5
18+
agents:
19+
provider: gcp
20+
image: family/elasticsearch-ubuntu-2004
21+
diskSizeGb: 350
22+
machineType: custom-32-98304

.buildkite/scripts/release-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ curl --fail -o "${ML_IVY_REPO}/maven/org/elasticsearch/ml/ml-cpp/${ES_VERSION}/m
2020
curl --fail -o "${ML_IVY_REPO}/maven/org/elasticsearch/ml/ml-cpp/${ES_VERSION}/ml-cpp-${ES_VERSION}.zip" https://artifacts-snapshot.elastic.co/ml-cpp/${ES_VERSION}-SNAPSHOT/downloads/ml-cpp/ml-cpp-${ES_VERSION}-SNAPSHOT.zip
2121

2222
.ci/scripts/run-gradle.sh -Dbwc.checkout.align=true -Dbuild.snapshot=false -Dbuild.ml_cpp.repo=file://${ML_IVY_REPO} \
23-
-Dtests.jvm.argline=-Dbuild.snapshot=false -Dlicense.key=${WORKSPACE}/x-pack/license-tools/src/test/resources/public.key -Dbuild.id=deadbeef assemble functionalTests
23+
-Dtests.jvm.argline=-Dbuild.snapshot=false -Dlicense.key=${WORKSPACE}/x-pack/license-tools/src/test/resources/public.key -Dbuild.id=deadbeef ${@:-functionalTests}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/*.interp li
1111
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer*.java linguist-generated=true
1212
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser*.java linguist-generated=true
1313
x-pack/plugin/esql/src/main/generated/** linguist-generated=true
14+
x-pack/plugin/esql/src/main/generated-src/** linguist-generated=true
1415

1516
# ESQL functions docs are autogenerated. More information at `docs/reference/esql/functions/README.md`
1617
docs/reference/esql/functions/*/** linguist-generated=true

benchmarks/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,12 @@ exit
126126
Grab the async profiler from https://github.com/jvm-profiling-tools/async-profiler
127127
and run `prof async` like so:
128128
```
129-
gradlew -p benchmarks/ run --args 'LongKeyedBucketOrdsBenchmark.multiBucket -prof "async:libPath=/home/nik9000/Downloads/tmp/async-profiler-1.8.3-linux-x64/build/libasyncProfiler.so;dir=/tmp/prof;output=flamegraph"'
129+
gradlew -p benchmarks/ run --args 'LongKeyedBucketOrdsBenchmark.multiBucket -prof "async:libPath=/home/nik9000/Downloads/async-profiler-3.0-29ee888-linux-x64/lib/libasyncProfiler.so;dir=/tmp/prof;output=flamegraph"'
130130
```
131131

132+
Note: As of January 2025 the latest release of async profiler doesn't work
133+
with our JDK but the nightly is fine.
134+
132135
If you are on Mac, this'll warn you that you downloaded the shared library from
133136
the internet. You'll need to go to settings and allow it to run.
134137

benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/EvalBenchmark.java

Lines changed: 79 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import org.elasticsearch.xpack.esql.expression.function.scalar.date.DateTrunc;
3939
import org.elasticsearch.xpack.esql.expression.function.scalar.math.Abs;
4040
import org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.MvMin;
41+
import org.elasticsearch.xpack.esql.expression.function.scalar.nulls.Coalesce;
4142
import org.elasticsearch.xpack.esql.expression.function.scalar.string.RLike;
4243
import org.elasticsearch.xpack.esql.expression.predicate.operator.arithmetic.Add;
4344
import org.elasticsearch.xpack.esql.expression.predicate.operator.comparison.Equals;
@@ -96,6 +97,9 @@ public class EvalBenchmark {
9697
"add_double",
9798
"case_1_eager",
9899
"case_1_lazy",
100+
"coalesce_2_noop",
101+
"coalesce_2_eager",
102+
"coalesce_2_lazy",
99103
"date_trunc",
100104
"equal_to_const",
101105
"long_equal_to_long",
@@ -142,8 +146,34 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) {
142146
lhs = new Add(Source.EMPTY, lhs, new Literal(Source.EMPTY, 1L, DataType.LONG));
143147
rhs = new Add(Source.EMPTY, rhs, new Literal(Source.EMPTY, 1L, DataType.LONG));
144148
}
145-
yield EvalMapper.toEvaluator(FOLD_CONTEXT, new Case(Source.EMPTY, condition, List.of(lhs, rhs)), layout(f1, f2))
146-
.get(driverContext);
149+
EvalOperator.ExpressionEvaluator evaluator = EvalMapper.toEvaluator(
150+
FOLD_CONTEXT,
151+
new Case(Source.EMPTY, condition, List.of(lhs, rhs)),
152+
layout(f1, f2)
153+
).get(driverContext);
154+
String desc = operation.endsWith("lazy") ? "CaseLazyEvaluator" : "CaseEagerEvaluator";
155+
if (evaluator.toString().contains(desc) == false) {
156+
throw new IllegalArgumentException("Evaluator was [" + evaluator + "] but expected one containing [" + desc + "]");
157+
}
158+
yield evaluator;
159+
}
160+
case "coalesce_2_noop", "coalesce_2_eager", "coalesce_2_lazy" -> {
161+
FieldAttribute f1 = longField();
162+
FieldAttribute f2 = longField();
163+
Expression lhs = f1;
164+
if (operation.endsWith("lazy")) {
165+
lhs = new Add(Source.EMPTY, lhs, new Literal(Source.EMPTY, 1L, DataType.LONG));
166+
}
167+
EvalOperator.ExpressionEvaluator evaluator = EvalMapper.toEvaluator(
168+
FOLD_CONTEXT,
169+
new Coalesce(Source.EMPTY, lhs, List.of(f2)),
170+
layout(f1, f2)
171+
).get(driverContext);
172+
String desc = operation.endsWith("lazy") ? "CoalesceLazyEvaluator" : "CoalesceEagerEvaluator";
173+
if (evaluator.toString().contains(desc) == false) {
174+
throw new IllegalArgumentException("Evaluator was [" + evaluator + "] but expected one containing [" + desc + "]");
175+
}
176+
yield evaluator;
147177
}
148178
case "date_trunc" -> {
149179
FieldAttribute timestamp = new FieldAttribute(
@@ -260,6 +290,38 @@ private static void checkExpected(String operation, Page actual) {
260290
}
261291
}
262292
}
293+
case "coalesce_2_noop" -> {
294+
LongVector f1 = actual.<LongBlock>getBlock(0).asVector();
295+
LongVector result = actual.<LongBlock>getBlock(2).asVector();
296+
for (int i = 0; i < BLOCK_LENGTH; i++) {
297+
long expected = f1.getLong(i);
298+
if (result.getLong(i) != expected) {
299+
throw new AssertionError("[" + operation + "] expected [" + expected + "] but was [" + result.getLong(i) + "]");
300+
}
301+
}
302+
}
303+
case "coalesce_2_eager" -> {
304+
LongBlock f1 = actual.<LongBlock>getBlock(0);
305+
LongVector f2 = actual.<LongBlock>getBlock(1).asVector();
306+
LongVector result = actual.<LongBlock>getBlock(2).asVector();
307+
for (int i = 0; i < BLOCK_LENGTH; i++) {
308+
long expected = i % 5 == 0 ? f2.getLong(i) : f1.getLong(f1.getFirstValueIndex(i));
309+
if (result.getLong(i) != expected) {
310+
throw new AssertionError("[" + operation + "] expected [" + expected + "] but was [" + result.getLong(i) + "]");
311+
}
312+
}
313+
}
314+
case "coalesce_2_lazy" -> {
315+
LongBlock f1 = actual.<LongBlock>getBlock(0);
316+
LongVector f2 = actual.<LongBlock>getBlock(1).asVector();
317+
LongVector result = actual.<LongBlock>getBlock(2).asVector();
318+
for (int i = 0; i < BLOCK_LENGTH; i++) {
319+
long expected = i % 5 == 0 ? f2.getLong(i) : f1.getLong(f1.getFirstValueIndex(i)) + 1;
320+
if (result.getLong(i) != expected) {
321+
throw new AssertionError("[" + operation + "] expected [" + expected + "] but was [" + result.getLong(i) + "]");
322+
}
323+
}
324+
}
263325
case "date_trunc" -> {
264326
LongVector v = actual.<LongBlock>getBlock(1).asVector();
265327
long oneDay = TimeValue.timeValueHours(24).millis();
@@ -304,7 +366,7 @@ private static void checkExpected(String operation, Page actual) {
304366
}
305367
}
306368
}
307-
default -> throw new UnsupportedOperationException();
369+
default -> throw new UnsupportedOperationException(operation);
308370
}
309371
}
310372

@@ -324,7 +386,7 @@ private static Page page(String operation) {
324386
}
325387
yield new Page(builder.build());
326388
}
327-
case "case_1_eager", "case_1_lazy" -> {
389+
case "case_1_eager", "case_1_lazy", "coalesce_2_noop" -> {
328390
var f1 = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
329391
var f2 = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
330392
for (int i = 0; i < BLOCK_LENGTH; i++) {
@@ -333,6 +395,19 @@ private static Page page(String operation) {
333395
}
334396
yield new Page(f1.build(), f2.build());
335397
}
398+
case "coalesce_2_eager", "coalesce_2_lazy" -> {
399+
var f1 = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
400+
var f2 = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
401+
for (int i = 0; i < BLOCK_LENGTH; i++) {
402+
if (i % 5 == 0) {
403+
f1.appendNull();
404+
} else {
405+
f1.appendLong(i);
406+
}
407+
f2.appendLong(-i);
408+
}
409+
yield new Page(f1.build(), f2.build());
410+
}
336411
case "long_equal_to_long" -> {
337412
var lhs = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
338413
var rhs = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);

build.gradle

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,22 +293,57 @@ allprojects {
293293
}
294294
}
295295

296+
ext.withReleaseBuild = { Closure config ->
297+
if(buildParams.snapshotBuild == false) {
298+
config.call()
299+
}
300+
}
301+
296302
plugins.withId('lifecycle-base') {
297303
if (project.path.startsWith(":x-pack:")) {
298304
if (project.path.contains("security") || project.path.contains(":ml")) {
299-
tasks.register('checkPart4') { dependsOn 'check' }
305+
tasks.register('checkPart4') {
306+
dependsOn 'check'
307+
withReleaseBuild {
308+
dependsOn 'assemble'
309+
}
310+
}
300311
} else if (project.path == ":x-pack:plugin" || project.path.contains("ql") || project.path.contains("smoke-test")) {
301-
tasks.register('checkPart3') { dependsOn 'check' }
312+
tasks.register('checkPart3') {
313+
dependsOn 'check'
314+
withReleaseBuild {
315+
dependsOn 'assemble'
316+
}
317+
}
302318
} else if (project.path.contains("multi-node")) {
303-
tasks.register('checkPart5') { dependsOn 'check' }
319+
tasks.register('checkPart5') {
320+
dependsOn 'check'
321+
withReleaseBuild {
322+
dependsOn 'assemble'
323+
}
324+
}
304325
} else {
305-
tasks.register('checkPart2') { dependsOn 'check' }
326+
tasks.register('checkPart2') {
327+
dependsOn 'check'
328+
withReleaseBuild {
329+
dependsOn 'assemble'
330+
}
331+
}
306332
}
307333
} else {
308-
tasks.register('checkPart1') { dependsOn 'check' }
334+
tasks.register('checkPart1') {
335+
dependsOn 'check'
336+
withReleaseBuild {
337+
dependsOn 'assemble'
338+
}
339+
}
340+
}
341+
tasks.register('functionalTests') {
342+
dependsOn 'check'
343+
withReleaseBuild {
344+
dependsOn 'assemble'
345+
}
309346
}
310-
311-
tasks.register('functionalTests') { dependsOn 'check' }
312347
}
313348

314349
/*

docs/changelog/118122.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118122
2+
summary: "ES|QL: Partial result on demand for async queries"
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/changelog/120256.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pr: 120256
2+
summary: Improve memory aspects of enrich cache
3+
area: Ingest Node
4+
type: enhancement
5+
issues:
6+
- 96050
7+
- 120021

docs/changelog/120629.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 120629
2+
summary: Report Deprecated Indices That Are Flagged To Ignore Migration Reindex As
3+
A Warning
4+
area: Data streams
5+
type: enhancement
6+
issues: []

docs/changelog/120645.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 120645
2+
summary: Esql Support date nanos on date diff function
3+
area: ES|QL
4+
type: enhancement
5+
issues:
6+
- 109999

0 commit comments

Comments
 (0)