Skip to content

Commit c28e9ba

Browse files
author
elasticsearchmachine
committed
Merge remote-tracking branch 'carlosdelest/non-issue/esql-function-loaders-pushdown-testing' into non-issue/esql-function-loaders-pushdown-testing
2 parents 30e9cc0 + 0aeb619 commit c28e9ba

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

x-pack/plugin/esql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/PushExpressionToLoadIT.java

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ public void testVHammingToBit() throws IOException {
372372
//
373373
public void testLengthPushedWithoutTopN() throws IOException {
374374
String textValue = "v".repeat(between(0, 256));
375-
test(b -> b.startObject("test").field("type", "keyword").endObject(),
375+
test(
376+
b -> b.startObject("test").field("type", "keyword").endObject(),
376377
b -> b.field("test", textValue),
377378
"""
378379
FROM test
@@ -381,8 +382,7 @@ public void testLengthPushedWithoutTopN() throws IOException {
381382
| KEEP test, fieldLength
382383
""",
383384
matchesList().item(textValue).item(textValue.length()),
384-
matchesList()
385-
.item(matchesMap().entry("name", "test").entry("type", any(String.class)))
385+
matchesList().item(matchesMap().entry("name", "test").entry("type", any(String.class)))
386386
.item(matchesMap().entry("name", "fieldLength").entry("type", any(String.class))),
387387
Map.of(
388388
"data",
@@ -401,9 +401,9 @@ public void testLengthPushedWithTopN() throws IOException {
401401
String textValue = "v".repeat(between(0, 256));
402402
Integer orderingValue = randomInt();
403403
test(b -> {
404-
b.startObject("test").field("type", "keyword").endObject();
405-
b.startObject("ordering").field("type", "integer").endObject();
406-
},
404+
b.startObject("test").field("type", "keyword").endObject();
405+
b.startObject("ordering").field("type", "integer").endObject();
406+
},
407407
b -> b.field("test", textValue).field("ordering", orderingValue),
408408
"""
409409
FROM test
@@ -416,9 +416,7 @@ public void testLengthPushedWithTopN() throws IOException {
416416
matchesList().item(matchesMap().entry("name", "test").entry("type", any(String.class))),
417417
Map.of(
418418
"data",
419-
List.of(
420-
matchesMap().entry("ordering:column_at_a_time:IntsFromDocValues.Singleton", 1)
421-
),
419+
List.of(matchesMap().entry("ordering:column_at_a_time:IntsFromDocValues.Singleton", 1)),
422420
"node_reduce",
423421
List.of(
424422
// Pushed down function
@@ -434,7 +432,8 @@ public void testLengthPushedWithTopN() throws IOException {
434432
public void testLengthPushedWithTopNAsOrder() throws IOException {
435433
String textValue = "v".repeat(between(0, 256));
436434
Integer orderingValue = randomInt();
437-
test(b -> b.startObject("test").field("type", "keyword").endObject(),
435+
test(
436+
b -> b.startObject("test").field("type", "keyword").endObject(),
438437
b -> b.field("test", textValue).field("ordering", orderingValue),
439438
"""
440439
FROM test
@@ -737,12 +736,19 @@ private void test(
737736
Consumer<List<String>> assertDataNodeSig
738737
) throws IOException {
739738

740-
test(mapping, doc, """
741-
FROM test
742-
""" + eval + """
743-
| STATS test = MV_SORT(VALUES(test))
744-
""", expectedValue, matchesList().item(matchesMap().entry("name", "test").entry("type", any(String.class))),
745-
Map.of("data", List.of(expectedLoaders)), assertDataNodeSig);
739+
test(
740+
mapping,
741+
doc,
742+
"""
743+
FROM test
744+
""" + eval + """
745+
| STATS test = MV_SORT(VALUES(test))
746+
""",
747+
expectedValue,
748+
matchesList().item(matchesMap().entry("name", "test").entry("type", any(String.class))),
749+
Map.of("data", List.of(expectedLoaders)),
750+
assertDataNodeSig
751+
);
746752
}
747753

748754
private void test(

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalLogicalPlanOptimizerTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,8 @@ public void testReductionPlanForTopNWithPushedDownFunctions() {
19271927
// Eval[[$$dense_vector$V_DOT_PRODUCT$1451583510{f$}#1110 AS score#1085]]
19281928
var eval = as(topN.child(), Eval.class);
19291929
assertThat(eval.fields(), hasSize(1));
1930-
var scoreAlias = eval.fields().stream()
1930+
var scoreAlias = eval.fields()
1931+
.stream()
19311932
.filter(f -> f.name().equals("score"))
19321933
.findFirst()
19331934
.orElseThrow(() -> new AssertionError("Field 'score' not found in eval"));

0 commit comments

Comments
 (0)