Skip to content

Commit 94f4373

Browse files
authored
Update EsqlPartitioningIT to cover match (#127246)
This commit updates the EsqlPartitioningIT to cover match. To ensure that match uses SHARD level parallelism.
1 parent b17adf1 commit 94f4373

File tree

1 file changed

+17
-3
lines changed
  • x-pack/plugin/esql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/single_node

1 file changed

+17
-3
lines changed

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ public class EsqlPartitioningIT extends ESRestTestCase {
4949
private static final long BASE_TIME = DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.parseMillis("2025-01-01T00:00:00Z");
5050
private static final int BULK_CHARS = Math.toIntExact(ByteSizeValue.ofMb(1).getBytes());
5151

52-
record Case(String suffix, String idxPartition) {}
52+
record Case(String suffix, String idxPartition, boolean score) {
53+
Case(String suffix, String idxPartition) {
54+
this(suffix, idxPartition, false);
55+
}
56+
}
5357

5458
@ParametersFactory(argumentFormatting = "[%1$s] %3$s -> %4$s")
5559
public static Iterable<Object[]> parameters() {
@@ -64,12 +68,22 @@ public static Iterable<Object[]> parameters() {
6468
new Case("| STATS SUM(a)", "DOC"),
6569
new Case("| MV_EXPAND a | STATS SUM(a)", "DOC"),
6670
new Case("| WHERE a == 1 | STATS SUM(a)", "SEGMENT"),
67-
new Case("| WHERE a == 1 | MV_EXPAND a | STATS SUM(a)", "SEGMENT"), }) {
71+
new Case("| WHERE a == 1 | MV_EXPAND a | STATS SUM(a)", "SEGMENT"),
72+
new Case("| WHERE MATCH(a, \"1\")", "SHARD"),
73+
new Case("| WHERE QSTR(\"a:1\")", "SHARD"),
74+
new Case("| WHERE KQL(\"a:1\")", "SHARD"),
75+
new Case("| WHERE a:\"1\"", "SHARD"),
76+
new Case("| WHERE MATCH(a, \"2\") | SORT _score DESC", "SHARD", true),
77+
new Case("| WHERE QSTR(\"a:2\") | SORT _score DESC", "SHARD", true),
78+
new Case("| WHERE KQL(\"a:2\") | SORT _score DESC", "SHARD", true),
79+
new Case("| WHERE MATCH(a, \"3\") | SORT _score DESC | LIMIT 10", "SHARD", true),
80+
new Case("| WHERE MATCH(a, \"3\") OR MATCH(a, \"4\") | SORT _score DESC | LIMIT 10", "SHARD", true),
81+
new Case("| WHERE a:\"3\" | WHERE a:\"4\" | SORT _score DESC | LIMIT 10", "SHARD", true), }) {
6882
params.add(
6983
new Object[] {
7084
defaultDataPartitioning,
7185
index,
72-
"FROM " + index + " " + c.suffix,
86+
"FROM " + index + (c.score ? " METADATA _score " : " ") + c.suffix,
7387
expectedPartition(defaultDataPartitioning, index, c.idxPartition) }
7488
);
7589
}

0 commit comments

Comments
 (0)