Skip to content

Commit 482a349

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 # server/src/main/java/org/elasticsearch/TransportVersions.java # x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/MapExpression.java # x-pack/plugin/esql/qa/testFixtures/src/main/resources/map-functions.csv-spec # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java # 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/expression/function/scalar/map/LogWithBaseInMap.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.interp # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.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/analysis/VerifierTests.java # x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LogicalPlanOptimizerTests.java
2 parents cdc7f94 + cbb7c24 commit 482a349

File tree

1,334 files changed

+21087
-11603
lines changed

Some content is hidden

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

1,334 files changed

+21087
-11603
lines changed

.buildkite/scripts/dra-workflow.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ WORKFLOW="${DRA_WORKFLOW:-snapshot}"
66
BRANCH="${BUILDKITE_BRANCH:-}"
77

88
# Don't publish main branch to staging
9-
if [[ ("$BRANCH" == "main" || "$BRANCH" == *.x) && "$WORKFLOW" == "staging" ]]; then
9+
if [[ "$BRANCH" == *.x && "$WORKFLOW" == "staging" ]]; then
1010
exit 0
1111
fi
1212

@@ -22,13 +22,19 @@ if [[ "$BRANCH" == "main" ]]; then
2222
fi
2323

2424
ES_VERSION=$(grep elasticsearch build-tools-internal/version.properties | sed "s/elasticsearch *= *//g")
25+
BASE_VERSION="$ES_VERSION"
2526
echo "ES_VERSION=$ES_VERSION"
2627

2728
VERSION_SUFFIX=""
2829
if [[ "$WORKFLOW" == "snapshot" ]]; then
2930
VERSION_SUFFIX="-SNAPSHOT"
3031
fi
3132

33+
if [[ -n "${VERSION_QUALIFIER:-}" ]]; then
34+
ES_VERSION="${ES_VERSION}-${VERSION_QUALIFIER}"
35+
echo "Version qualifier specified. ES_VERSION=${ES_VERSION}."
36+
fi
37+
3238
BEATS_BUILD_ID="$(./.ci/scripts/resolve-dra-manifest.sh beats "$RM_BRANCH" "$ES_VERSION" "$WORKFLOW")"
3339
echo "BEATS_BUILD_ID=$BEATS_BUILD_ID"
3440

@@ -37,6 +43,7 @@ echo "ML_CPP_BUILD_ID=$ML_CPP_BUILD_ID"
3743

3844
LICENSE_KEY_ARG=""
3945
BUILD_SNAPSHOT_ARG=""
46+
VERSION_QUALIFIER_ARG=""
4047

4148
if [[ "$WORKFLOW" == "staging" ]]; then
4249
LICENSE_KEY=$(mktemp -d)/license.key
@@ -47,6 +54,10 @@ if [[ "$WORKFLOW" == "staging" ]]; then
4754
BUILD_SNAPSHOT_ARG="-Dbuild.snapshot=false"
4855
fi
4956

57+
if [[ -n "${VERSION_QUALIFIER:-}" ]]; then
58+
VERSION_QUALIFIER_ARG="-Dbuild.version_qualifier=$VERSION_QUALIFIER"
59+
fi
60+
5061
echo --- Building release artifacts
5162

5263
.ci/scripts/run-gradle.sh -Ddra.artifacts=true \
@@ -56,12 +67,17 @@ echo --- Building release artifacts
5667
-Dcsv="$WORKSPACE/build/distributions/dependencies-${ES_VERSION}${VERSION_SUFFIX}.csv" \
5768
$LICENSE_KEY_ARG \
5869
$BUILD_SNAPSHOT_ARG \
70+
$VERSION_QUALIFIER_ARG \
5971
buildReleaseArtifacts \
6072
exportCompressedDockerImages \
6173
:distribution:generateDependenciesReport
6274

6375
PATH="$PATH:${JAVA_HOME}/bin" # Required by the following script
76+
if [[ -z "${VERSION_QUALIFIER:-}" ]]; then
6477
x-pack/plugin/sql/connectors/tableau/package.sh asm qualifier="$VERSION_SUFFIX"
78+
else
79+
x-pack/plugin/sql/connectors/tableau/package.sh asm qualifier="-$VERSION_QUALIFIER"
80+
fi
6581

6682
# we regenerate this file as part of the release manager invocation
6783
rm "build/distributions/elasticsearch-jdbc-${ES_VERSION}${VERSION_SUFFIX}.taco.sha512"
@@ -88,7 +104,8 @@ docker run --rm \
88104
--branch "$RM_BRANCH" \
89105
--commit "$BUILDKITE_COMMIT" \
90106
--workflow "$WORKFLOW" \
91-
--version "$ES_VERSION" \
107+
--qualifier "${VERSION_QUALIFIER:-}" \
108+
--version "$BASE_VERSION" \
92109
--artifact-set main \
93110
--dependency "beats:https://artifacts-${WORKFLOW}.elastic.co/beats/${BEATS_BUILD_ID}/manifest-${ES_VERSION}${VERSION_SUFFIX}.json" \
94111
--dependency "ml-cpp:https://artifacts-${WORKFLOW}.elastic.co/ml-cpp/${ML_CPP_BUILD_ID}/manifest-${ES_VERSION}${VERSION_SUFFIX}.json"

.buildkite/scripts/dra-workflow.trigger.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ source .buildkite/scripts/branches.sh
88

99
for BRANCH in "${BRANCHES[@]}"; do
1010
if [[ "$BRANCH" == "main" ]]; then
11-
continue
11+
export VERSION_QUALIFIER="alpha1"
1212
fi
1313

1414
INTAKE_PIPELINE_SLUG="elasticsearch-intake"
@@ -24,5 +24,6 @@ for BRANCH in "${BRANCHES[@]}"; do
2424
commit: "$LAST_GOOD_COMMIT"
2525
env:
2626
DRA_WORKFLOW: staging
27+
VERSION_QUALIFIER: ${VERSION_QUALIFIER:-}
2728
EOF
2829
done

.buildkite/scripts/get-latest-test-mutes.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
if [[ ! "${BUILDKITE_PULL_REQUEST:-}" || "${BUILDKITE_AGENT_META_DATA_PROVIDER:-}" == "k8s" ]]; then
3+
if [[ "${BUILDKITE_PULL_REQUEST:-false}" == "false" || "${BUILDKITE_AGENT_META_DATA_PROVIDER:-}" == "k8s" ]]; then
44
exit 0
55
fi
66

benchmarks/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import org.elasticsearch.gradle.internal.test.TestUtil
2+
import org.elasticsearch.gradle.OS
23

34
/*
45
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -77,7 +78,7 @@ tasks.register("copyPainless", Copy) {
7778
}
7879

7980
tasks.named("run").configure {
80-
executable = "${buildParams.runtimeJavaHome.get()}/bin/java"
81+
executable = "${buildParams.runtimeJavaHome.get()}/bin/java" + (OS.current() == OS.WINDOWS ? '.exe' : '')
8182
args << "-Dplugins.dir=${buildDir}/plugins" << "-Dtests.index=${buildDir}/index"
8283
dependsOn "copyExpression", "copyPainless", configurations.nativeLib
8384
systemProperty 'es.nativelibs.path', TestUtil.getTestLibraryPath(file("../libs/native/libraries/build/platform/").toString())

benchmarks/src/main/java/org/elasticsearch/benchmark/bytes/BytesArrayReadLongBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class BytesArrayReadLongBenchmark {
4747
@Setup
4848
public void initResults() throws IOException {
4949
final BytesStreamOutput tmp = new BytesStreamOutput();
50-
final long bytes = new ByteSizeValue(dataMb, ByteSizeUnit.MB).getBytes();
50+
final long bytes = ByteSizeValue.of(dataMb, ByteSizeUnit.MB).getBytes();
5151
for (int i = 0; i < bytes / 8; i++) {
5252
tmp.writeLong(i);
5353
}

benchmarks/src/main/java/org/elasticsearch/benchmark/bytes/PagedBytesReferenceReadLongBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class PagedBytesReferenceReadLongBenchmark {
4747
@Setup
4848
public void initResults() throws IOException {
4949
final BytesStreamOutput tmp = new BytesStreamOutput();
50-
final long bytes = new ByteSizeValue(dataMb, ByteSizeUnit.MB).getBytes();
50+
final long bytes = ByteSizeValue.of(dataMb, ByteSizeUnit.MB).getBytes();
5151
for (int i = 0; i < bytes / 8; i++) {
5252
tmp.writeLong(i);
5353
}

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

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.elasticsearch.core.TimeValue;
2828
import org.elasticsearch.xpack.esql.core.expression.Expression;
2929
import org.elasticsearch.xpack.esql.core.expression.FieldAttribute;
30+
import org.elasticsearch.xpack.esql.core.expression.FoldContext;
3031
import org.elasticsearch.xpack.esql.core.expression.Literal;
3132
import org.elasticsearch.xpack.esql.core.expression.predicate.regex.RLikePattern;
3233
import org.elasticsearch.xpack.esql.core.tree.Source;
@@ -71,12 +72,11 @@ public class EvalBenchmark {
7172
BigArrays.NON_RECYCLING_INSTANCE
7273
);
7374

75+
private static final FoldContext FOLD_CONTEXT = FoldContext.small();
76+
7477
private static final int BLOCK_LENGTH = 8 * 1024;
7578

76-
static final DriverContext driverContext = new DriverContext(
77-
BigArrays.NON_RECYCLING_INSTANCE,
78-
BlockFactory.getInstance(new NoopCircuitBreaker("noop"), BigArrays.NON_RECYCLING_INSTANCE)
79-
);
79+
static final DriverContext driverContext = new DriverContext(BigArrays.NON_RECYCLING_INSTANCE, blockFactory);
8080

8181
static {
8282
// Smoke test all the expected values and force loading subclasses more like prod
@@ -114,18 +114,20 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) {
114114
return switch (operation) {
115115
case "abs" -> {
116116
FieldAttribute longField = longField();
117-
yield EvalMapper.toEvaluator(new Abs(Source.EMPTY, longField), layout(longField)).get(driverContext);
117+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, new Abs(Source.EMPTY, longField), layout(longField)).get(driverContext);
118118
}
119119
case "add" -> {
120120
FieldAttribute longField = longField();
121121
yield EvalMapper.toEvaluator(
122+
FOLD_CONTEXT,
122123
new Add(Source.EMPTY, longField, new Literal(Source.EMPTY, 1L, DataType.LONG)),
123124
layout(longField)
124125
).get(driverContext);
125126
}
126127
case "add_double" -> {
127128
FieldAttribute doubleField = doubleField();
128129
yield EvalMapper.toEvaluator(
130+
FOLD_CONTEXT,
129131
new Add(Source.EMPTY, doubleField, new Literal(Source.EMPTY, 1D, DataType.DOUBLE)),
130132
layout(doubleField)
131133
).get(driverContext);
@@ -140,7 +142,8 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) {
140142
lhs = new Add(Source.EMPTY, lhs, new Literal(Source.EMPTY, 1L, DataType.LONG));
141143
rhs = new Add(Source.EMPTY, rhs, new Literal(Source.EMPTY, 1L, DataType.LONG));
142144
}
143-
yield EvalMapper.toEvaluator(new Case(Source.EMPTY, condition, List.of(lhs, rhs)), layout(f1, f2)).get(driverContext);
145+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, new Case(Source.EMPTY, condition, List.of(lhs, rhs)), layout(f1, f2))
146+
.get(driverContext);
144147
}
145148
case "date_trunc" -> {
146149
FieldAttribute timestamp = new FieldAttribute(
@@ -149,35 +152,37 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) {
149152
new EsField("timestamp", DataType.DATETIME, Map.of(), true)
150153
);
151154
yield EvalMapper.toEvaluator(
155+
FOLD_CONTEXT,
152156
new DateTrunc(Source.EMPTY, new Literal(Source.EMPTY, Duration.ofHours(24), DataType.TIME_DURATION), timestamp),
153157
layout(timestamp)
154158
).get(driverContext);
155159
}
156160
case "equal_to_const" -> {
157161
FieldAttribute longField = longField();
158162
yield EvalMapper.toEvaluator(
163+
FOLD_CONTEXT,
159164
new Equals(Source.EMPTY, longField, new Literal(Source.EMPTY, 100_000L, DataType.LONG)),
160165
layout(longField)
161166
).get(driverContext);
162167
}
163168
case "long_equal_to_long" -> {
164169
FieldAttribute lhs = longField();
165170
FieldAttribute rhs = longField();
166-
yield EvalMapper.toEvaluator(new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get(driverContext);
171+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get(driverContext);
167172
}
168173
case "long_equal_to_int" -> {
169174
FieldAttribute lhs = longField();
170175
FieldAttribute rhs = intField();
171-
yield EvalMapper.toEvaluator(new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get(driverContext);
176+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get(driverContext);
172177
}
173178
case "mv_min", "mv_min_ascending" -> {
174179
FieldAttribute longField = longField();
175-
yield EvalMapper.toEvaluator(new MvMin(Source.EMPTY, longField), layout(longField)).get(driverContext);
180+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, new MvMin(Source.EMPTY, longField), layout(longField)).get(driverContext);
176181
}
177182
case "rlike" -> {
178183
FieldAttribute keywordField = keywordField();
179184
RLike rlike = new RLike(Source.EMPTY, keywordField, new RLikePattern(".ar"));
180-
yield EvalMapper.toEvaluator(rlike, layout(keywordField)).get(driverContext);
185+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, rlike, layout(keywordField)).get(driverContext);
181186
}
182187
default -> throw new UnsupportedOperationException();
183188
};

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/DockerBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public enum DockerBase {
2222
// Chainguard based wolfi image with latest jdk
2323
// This is usually updated via renovatebot
2424
// spotless:off
25-
WOLFI("docker.elastic.co/wolfi/chainguard-base:latest@sha256:eef54b3a414aa53b98f0f8df2633aed83c3ba6230722769282925442968f0364",
25+
WOLFI("docker.elastic.co/wolfi/chainguard-base:latest@sha256:dd66beec64a7f9b19c6c35a1195153b2b630a55e16ec71949ed5187c5947eea1",
2626
"-wolfi",
2727
"apk"
2828
),

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaModulePathPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void apply(Project project) {
5353
}
5454

5555
// List of root tasks, by name, whose compileJava task should not use the module path. These are test related sources.
56-
static final Set<String> EXCLUDES = Set.of(":test:framework", ":x-pack:plugin:eql:qa:common");
56+
static final Set<String> EXCLUDES = Set.of(":test:framework", ":x-pack:plugin:eql:qa:common", ":x-pack:plugin:esql:compute:test");
5757

5858
void configureCompileModulePath(Project project) {
5959
// first disable Gradle's builtin module path inference

build-tools/src/main/java/org/elasticsearch/gradle/testclusters/TestClustersAware.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public interface TestClustersAware extends Task {
2626
Collection<ElasticsearchCluster> getClusters();
2727

2828
@ServiceReference(REGISTRY_SERVICE_NAME)
29-
Property<TestClustersRegistry> getRegistery();
29+
Property<TestClustersRegistry> getRegistry();
3030

3131
@ServiceReference(TEST_CLUSTER_TASKS_SERVICE)
3232
Property<TestClustersPlugin.TaskEventsService> getTasksService();
@@ -47,6 +47,14 @@ default void useCluster(ElasticsearchCluster cluster) {
4747
getClusters().add(cluster);
4848
}
4949

50+
default Provider<TestClusterInfo> getClusterInfo(String clusterName) {
51+
return getProject().getProviders().of(TestClusterValueSource.class, source -> {
52+
source.getParameters().getService().set(getRegistry());
53+
source.getParameters().getClusterName().set(clusterName);
54+
source.getParameters().getPath().set(getProject().getIsolated().getPath());
55+
});
56+
}
57+
5058
default void useCluster(Provider<ElasticsearchCluster> cluster) {
5159
useCluster(cluster.get());
5260
}

0 commit comments

Comments
 (0)