Skip to content

Commit 8fe4f9c

Browse files
committed
Merge branch 'main' into local-xpack-usage
2 parents a9866d3 + cf83c37 commit 8fe4f9c

File tree

6,357 files changed

+218863
-409283
lines changed

Some content is hidden

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

6,357 files changed

+218863
-409283
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
steps:
2+
- label: $FWC_VERSION / fwc
3+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v$FWC_VERSION#fwcTest -Dtests.bwc.snapshot=false
4+
timeout_in_minutes: 300
5+
agents:
6+
provider: gcp
7+
image: family/elasticsearch-ubuntu-2004
8+
machineType: n1-standard-32
9+
buildDirectory: /dev/shm/bk
10+
matrix:
11+
setup:
12+
FWC_VERSION: $FWC_LIST
13+
env:
14+
FWC_VERSION: $FWC_VERSION
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file is auto-generated. See .buildkite/pipelines/periodic-fwc.template.yml
2+
steps:
3+
- label: $FWC_VERSION / fwc
4+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v$FWC_VERSION#fwcTest -Dtests.bwc.snapshot=false
5+
timeout_in_minutes: 300
6+
agents:
7+
provider: gcp
8+
image: family/elasticsearch-ubuntu-2004
9+
machineType: n1-standard-32
10+
buildDirectory: /dev/shm/bk
11+
matrix:
12+
setup:
13+
FWC_VERSION: []
14+
env:
15+
FWC_VERSION: $FWC_VERSION

.buildkite/scripts/branches.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22

33
# This determines which branches will have pipelines triggered periodically, for dra workflows.
44
BRANCHES=( $(cat branches.json | jq -r '.branches[].branch') )
5+
6+
# Sort them to make ordering predictable
7+
IFS=$'\n' BRANCHES=($(sort <<<"${BRANCHES[*]}"))
8+
unset IFS

.buildkite/scripts/periodic.trigger.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,15 @@ EOF
4646
branch: "$BRANCH"
4747
commit: "$LAST_GOOD_COMMIT"
4848
EOF
49+
# Include forward compatibility tests only for the bugfix branch
50+
if [[ "${BRANCH}" == "${BRANCHES[2]}" ]]; then
51+
cat <<EOF
52+
- trigger: elasticsearch-periodic-fwc
53+
label: Trigger periodic-fwc pipeline for $BRANCH
54+
async: true
55+
build:
56+
branch: "$BRANCH"
57+
commit: "$LAST_GOOD_COMMIT"
58+
EOF
59+
fi
4960
done

.github/workflows/comment-on-asciidoc-changes.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/docs-build.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: docs-build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request_target: ~
8+
merge_group: ~
9+
10+
jobs:
11+
docs-preview:
12+
uses: elastic/docs-builder/.github/workflows/preview-build.yml@main
13+
with:
14+
path-pattern: docs/**
15+
permissions:
16+
deployments: write
17+
id-token: write
18+
contents: read
19+
pull-requests: read

.github/workflows/docs-cleanup.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: docs-cleanup
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- closed
7+
8+
jobs:
9+
docs-preview:
10+
uses: elastic/docs-builder/.github/workflows/preview-cleanup.yml@main
11+
permissions:
12+
contents: none
13+
id-token: write
14+
deployments: write

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
import java.util.stream.LongStream;
6161
import java.util.stream.Stream;
6262

63+
/**
64+
* Benchmark for many different kinds of aggregator and groupings.
65+
*/
6366
@Warmup(iterations = 5)
6467
@Measurement(iterations = 7)
6568
@BenchmarkMode(Mode.AverageTime)

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

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111

1212
import org.apache.lucene.util.BytesRef;
1313
import org.elasticsearch.common.breaker.NoopCircuitBreaker;
14+
import org.elasticsearch.common.settings.Settings;
1415
import org.elasticsearch.common.util.BigArrays;
1516
import org.elasticsearch.compute.data.Block;
1617
import org.elasticsearch.compute.data.BlockFactory;
1718
import org.elasticsearch.compute.data.BooleanBlock;
1819
import org.elasticsearch.compute.data.BooleanVector;
20+
import org.elasticsearch.compute.data.BytesRefBlock;
21+
import org.elasticsearch.compute.data.BytesRefVector;
1922
import org.elasticsearch.compute.data.DoubleBlock;
2023
import org.elasticsearch.compute.data.DoubleVector;
2124
import org.elasticsearch.compute.data.LongBlock;
@@ -40,9 +43,13 @@
4043
import org.elasticsearch.xpack.esql.expression.function.scalar.multivalue.MvMin;
4144
import org.elasticsearch.xpack.esql.expression.function.scalar.nulls.Coalesce;
4245
import org.elasticsearch.xpack.esql.expression.function.scalar.string.RLike;
46+
import org.elasticsearch.xpack.esql.expression.function.scalar.string.ToLower;
47+
import org.elasticsearch.xpack.esql.expression.function.scalar.string.ToUpper;
4348
import org.elasticsearch.xpack.esql.expression.predicate.operator.arithmetic.Add;
4449
import org.elasticsearch.xpack.esql.expression.predicate.operator.comparison.Equals;
4550
import org.elasticsearch.xpack.esql.planner.Layout;
51+
import org.elasticsearch.xpack.esql.plugin.EsqlPlugin;
52+
import org.elasticsearch.xpack.esql.session.Configuration;
4653
import org.openjdk.jmh.annotations.Benchmark;
4754
import org.openjdk.jmh.annotations.BenchmarkMode;
4855
import org.openjdk.jmh.annotations.Fork;
@@ -56,8 +63,10 @@
5663
import org.openjdk.jmh.annotations.Warmup;
5764

5865
import java.time.Duration;
66+
import java.time.ZoneOffset;
5967
import java.util.Arrays;
6068
import java.util.List;
69+
import java.util.Locale;
6170
import java.util.Map;
6271
import java.util.concurrent.TimeUnit;
6372

@@ -106,7 +115,9 @@ public class EvalBenchmark {
106115
"long_equal_to_int",
107116
"mv_min",
108117
"mv_min_ascending",
109-
"rlike" }
118+
"rlike",
119+
"to_lower",
120+
"to_upper" }
110121
)
111122
public String operation;
112123

@@ -169,7 +180,7 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) {
169180
new Coalesce(Source.EMPTY, lhs, List.of(f2)),
170181
layout(f1, f2)
171182
).get(driverContext);
172-
String desc = operation.endsWith("lazy") ? "CoalesceLazyEvaluator" : "CoalesceEagerEvaluator";
183+
String desc = operation.endsWith("lazy") ? "CoalesceLongLazyEvaluator" : "CoalesceLongEagerEvaluator";
173184
if (evaluator.toString().contains(desc) == false) {
174185
throw new IllegalArgumentException("Evaluator was [" + evaluator + "] but expected one containing [" + desc + "]");
175186
}
@@ -214,6 +225,16 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) {
214225
RLike rlike = new RLike(Source.EMPTY, keywordField, new RLikePattern(".ar"));
215226
yield EvalMapper.toEvaluator(FOLD_CONTEXT, rlike, layout(keywordField)).get(driverContext);
216227
}
228+
case "to_lower" -> {
229+
FieldAttribute keywordField = keywordField();
230+
ToLower toLower = new ToLower(Source.EMPTY, keywordField, configuration());
231+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, toLower, layout(keywordField)).get(driverContext);
232+
}
233+
case "to_upper" -> {
234+
FieldAttribute keywordField = keywordField();
235+
ToUpper toUpper = new ToUpper(Source.EMPTY, keywordField, configuration());
236+
yield EvalMapper.toEvaluator(FOLD_CONTEXT, toUpper, layout(keywordField)).get(driverContext);
237+
}
217238
default -> throw new UnsupportedOperationException();
218239
};
219240
}
@@ -234,6 +255,23 @@ private static FieldAttribute keywordField() {
234255
return new FieldAttribute(Source.EMPTY, "keyword", new EsField("keyword", DataType.KEYWORD, Map.of(), true));
235256
}
236257

258+
private static Configuration configuration() {
259+
return new Configuration(
260+
ZoneOffset.UTC,
261+
Locale.ROOT,
262+
null,
263+
null,
264+
null,
265+
EsqlPlugin.QUERY_RESULT_TRUNCATION_MAX_SIZE.get(Settings.EMPTY),
266+
EsqlPlugin.QUERY_RESULT_TRUNCATION_DEFAULT_SIZE.get(Settings.EMPTY),
267+
null,
268+
false,
269+
Map.of(),
270+
0,
271+
false
272+
);
273+
}
274+
237275
private static Layout layout(FieldAttribute... fields) {
238276
Layout.Builder layout = new Layout.Builder();
239277
layout.append(Arrays.asList(fields));
@@ -366,10 +404,24 @@ private static void checkExpected(String operation, Page actual) {
366404
}
367405
}
368406
}
407+
case "to_lower" -> checkBytes(operation, actual, new BytesRef[] { new BytesRef("foo"), new BytesRef("bar") });
408+
case "to_upper" -> checkBytes(operation, actual, new BytesRef[] { new BytesRef("FOO"), new BytesRef("BAR") });
369409
default -> throw new UnsupportedOperationException(operation);
370410
}
371411
}
372412

413+
private static void checkBytes(String operation, Page actual, BytesRef[] expectedVals) {
414+
BytesRef scratch = new BytesRef();
415+
BytesRefVector v = actual.<BytesRefBlock>getBlock(1).asVector();
416+
for (int i = 0; i < BLOCK_LENGTH; i++) {
417+
BytesRef expected = expectedVals[i % 2];
418+
BytesRef b = v.getBytesRef(i, scratch);
419+
if (b.equals(expected) == false) {
420+
throw new AssertionError("[" + operation + "] expected [" + expected + "] but was [" + b + "]");
421+
}
422+
}
423+
}
424+
373425
private static Page page(String operation) {
374426
return switch (operation) {
375427
case "abs", "add", "date_trunc", "equal_to_const" -> {
@@ -440,7 +492,7 @@ private static Page page(String operation) {
440492
}
441493
yield new Page(builder.build());
442494
}
443-
case "rlike" -> {
495+
case "rlike", "to_lower", "to_upper" -> {
444496
var builder = blockFactory.newBytesRefVectorBuilder(BLOCK_LENGTH);
445497
BytesRef[] values = new BytesRef[] { new BytesRef("foo"), new BytesRef("bar") };
446498
for (int i = 0; i < BLOCK_LENGTH; i++) {

0 commit comments

Comments
 (0)