Skip to content

Commit e5469a7

Browse files
committed
Compile
1 parent 4427964 commit e5469a7

File tree

4 files changed

+50
-19
lines changed

4 files changed

+50
-19
lines changed

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/lucene/LuceneQueryEvaluatorTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ private List<Page> runQuery(Set<String> values, Query query, boolean shuffleDocs
209209
List.of(new ValuesSourceReaderOperator.ShardContext(reader, () -> {
210210
throw new UnsupportedOperationException();
211211
})),
212-
0
212+
0,
213+
0.1
213214
)
214215
);
215216
LuceneQueryEvaluator.ShardConfig[] shards = new LuceneQueryEvaluator.ShardConfig[] {

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/lucene/ValueSourceReaderTypeConversionTests.java

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
import java.util.stream.IntStream;
109109
import java.util.stream.LongStream;
110110

111+
import static org.elasticsearch.compute.lucene.ValuesSourceReaderOperatorTests.STORED_FIELDS_SEQUENTIAL_PROPORTIONS;
111112
import static org.elasticsearch.test.MapMatcher.assertMap;
112113
import static org.elasticsearch.test.MapMatcher.matchesMap;
113114
import static org.elasticsearch.xpack.esql.core.type.DataType.IP;
@@ -239,7 +240,7 @@ private static Operator.OperatorFactory factory(
239240
fail("unexpected shardIdx [" + shardIdx + "]");
240241
}
241242
return loader;
242-
})), shardContexts, 0);
243+
})), shardContexts, 0, STORED_FIELDS_SEQUENTIAL_PROPORTIONS);
243244
}
244245

245246
protected SourceOperator simpleInput(DriverContext context, int size) {
@@ -488,7 +489,8 @@ public void testManySingleDocPages() {
488489
new ValuesSourceReaderOperator.Factory(
489490
List.of(testCase.info, fieldInfo(mapperService(indexKey).fieldType("key"), ElementType.INT)),
490491
shardContexts,
491-
0
492+
0,
493+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
492494
).get(driverContext)
493495
);
494496
List<Page> results = drive(operators, input.iterator(), driverContext);
@@ -598,7 +600,8 @@ private void loadSimpleAndAssert(
598600
fieldInfo(mapperService("index1").fieldType("indexKey"), ElementType.BYTES_REF)
599601
),
600602
shardContexts,
601-
0
603+
0,
604+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
602605
).get(driverContext)
603606
);
604607
List<FieldCase> tests = new ArrayList<>();
@@ -607,7 +610,12 @@ private void loadSimpleAndAssert(
607610
cases.removeAll(b);
608611
tests.addAll(b);
609612
operators.add(
610-
new ValuesSourceReaderOperator.Factory(b.stream().map(i -> i.info).toList(), shardContexts, 0).get(driverContext)
613+
new ValuesSourceReaderOperator.Factory(
614+
b.stream().map(i -> i.info).toList(),
615+
shardContexts,
616+
0,
617+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
618+
).get(driverContext)
611619
);
612620
}
613621
List<Page> results = drive(operators, input.iterator(), driverContext);
@@ -709,7 +717,11 @@ private void testLoadAllStatus(boolean allInOnePage) {
709717
Block.MvOrdering.DEDUPLICATED_AND_SORTED_ASCENDING
710718
);
711719
List<Operator> operators = cases.stream()
712-
.map(i -> new ValuesSourceReaderOperator.Factory(List.of(i.info), shardContexts, 0).get(driverContext))
720+
.map(
721+
i -> new ValuesSourceReaderOperator.Factory(List.of(i.info), shardContexts, 0, STORED_FIELDS_SEQUENTIAL_PROPORTIONS).get(
722+
driverContext
723+
)
724+
)
713725
.toList();
714726
if (allInOnePage) {
715727
input = List.of(CannedSourceOperator.mergePages(input));
@@ -1385,7 +1397,8 @@ public void testNullsShared() {
13851397
new ValuesSourceReaderOperator.FieldInfo("null2", ElementType.NULL, shardIdx -> BlockLoader.CONSTANT_NULLS)
13861398
),
13871399
shardContexts,
1388-
0
1400+
0,
1401+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
13891402
).get(driverContext)
13901403
),
13911404
new PageConsumerOperator(page -> {
@@ -1416,7 +1429,8 @@ public void testDescriptionOfMany() throws IOException {
14161429
ValuesSourceReaderOperator.Factory factory = new ValuesSourceReaderOperator.Factory(
14171430
cases.stream().map(c -> c.info).toList(),
14181431
List.of(new ValuesSourceReaderOperator.ShardContext(reader(indexKey), () -> SourceLoader.FROM_STORED_SOURCE)),
1419-
0
1432+
0,
1433+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
14201434
);
14211435
assertThat(factory.describe(), equalTo("ValuesSourceReaderOperator[fields = [" + cases.size() + " fields]]"));
14221436
try (Operator op = factory.get(driverContext())) {
@@ -1462,7 +1476,8 @@ public void testManyShards() throws IOException {
14621476
return ft.blockLoader(blContext());
14631477
})),
14641478
readerShardContexts,
1465-
0
1479+
0,
1480+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
14661481
);
14671482
DriverContext driverContext = driverContext();
14681483
List<Page> results = drive(

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/lucene/ValuesSourceReaderOperatorTests.java

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ public class ValuesSourceReaderOperatorTests extends OperatorTestCase {
114114
{ false, true, true },
115115
{ false, false, true, true } };
116116

117+
static final double STORED_FIELDS_SEQUENTIAL_PROPORTIONS = 0.1;
118+
117119
private Directory directory = newDirectory();
118120
private MapperService mapperService;
119121
private IndexReader reader;
@@ -147,7 +149,11 @@ static Operator.OperatorFactory factory(IndexReader reader, String name, Element
147149
fail("unexpected shardIdx [" + shardIdx + "]");
148150
}
149151
return loader;
150-
})), List.of(new ValuesSourceReaderOperator.ShardContext(reader, () -> SourceLoader.FROM_STORED_SOURCE)), 0);
152+
})),
153+
List.of(new ValuesSourceReaderOperator.ShardContext(reader, () -> SourceLoader.FROM_STORED_SOURCE)),
154+
0,
155+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
156+
);
151157
}
152158

153159
@Override
@@ -444,7 +450,8 @@ public void testManySingleDocPages() {
444450
new ValuesSourceReaderOperator.Factory(
445451
List.of(testCase.info, fieldInfo(mapperService.fieldType("key"), ElementType.INT)),
446452
List.of(new ValuesSourceReaderOperator.ShardContext(reader, () -> SourceLoader.FROM_STORED_SOURCE)),
447-
0
453+
0,
454+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
448455
).get(driverContext)
449456
);
450457
List<Page> results = drive(operators, input.iterator(), driverContext);
@@ -550,7 +557,8 @@ private void loadSimpleAndAssert(
550557
new ValuesSourceReaderOperator.Factory(
551558
List.of(fieldInfo(mapperService.fieldType("key"), ElementType.INT)),
552559
List.of(new ValuesSourceReaderOperator.ShardContext(reader, () -> SourceLoader.FROM_STORED_SOURCE)),
553-
0
560+
0,
561+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
554562
).get(driverContext)
555563
);
556564
List<FieldCase> tests = new ArrayList<>();
@@ -562,7 +570,8 @@ private void loadSimpleAndAssert(
562570
new ValuesSourceReaderOperator.Factory(
563571
b.stream().map(i -> i.info).toList(),
564572
List.of(new ValuesSourceReaderOperator.ShardContext(reader, () -> SourceLoader.FROM_STORED_SOURCE)),
565-
0
573+
0,
574+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
566575
).get(driverContext)
567576
);
568577
}
@@ -652,7 +661,8 @@ private void testLoadAllStatus(boolean allInOnePage) {
652661
i -> new ValuesSourceReaderOperator.Factory(
653662
List.of(i.info),
654663
List.of(new ValuesSourceReaderOperator.ShardContext(reader, () -> SourceLoader.FROM_STORED_SOURCE)),
655-
0
664+
0,
665+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
656666
).get(driverContext)
657667
)
658668
.toList();
@@ -1418,7 +1428,8 @@ public void testNullsShared() {
14181428
new ValuesSourceReaderOperator.FieldInfo("null2", ElementType.NULL, shardIdx -> BlockLoader.CONSTANT_NULLS)
14191429
),
14201430
List.of(new ValuesSourceReaderOperator.ShardContext(reader, () -> SourceLoader.FROM_STORED_SOURCE)),
1421-
0
1431+
0,
1432+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
14221433
).get(driverContext)
14231434
),
14241435
new PageConsumerOperator(page -> {
@@ -1463,7 +1474,8 @@ private void testSequentialStoredFields(boolean sequential, int docCount) throws
14631474
fieldInfo(storedTextField("stored_text"), ElementType.BYTES_REF)
14641475
),
14651476
List.of(new ValuesSourceReaderOperator.ShardContext(reader, () -> SourceLoader.FROM_STORED_SOURCE)),
1466-
0
1477+
0,
1478+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
14671479
).get(driverContext);
14681480
List<Page> results = drive(op, source.iterator(), driverContext);
14691481
Checks checks = new Checks(Block.MvOrdering.UNORDERED, Block.MvOrdering.UNORDERED);
@@ -1491,7 +1503,8 @@ public void testDescriptionOfMany() throws IOException {
14911503
ValuesSourceReaderOperator.Factory factory = new ValuesSourceReaderOperator.Factory(
14921504
cases.stream().map(c -> c.info).toList(),
14931505
List.of(new ValuesSourceReaderOperator.ShardContext(reader, () -> SourceLoader.FROM_STORED_SOURCE)),
1494-
0
1506+
0,
1507+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
14951508
);
14961509
assertThat(factory.describe(), equalTo("ValuesSourceReaderOperator[fields = [" + cases.size() + " fields]]"));
14971510
try (Operator op = factory.get(driverContext())) {
@@ -1535,7 +1548,8 @@ public void testManyShards() throws IOException {
15351548
return ft.blockLoader(blContext());
15361549
})),
15371550
readerShardContexts,
1538-
0
1551+
0,
1552+
STORED_FIELDS_SEQUENTIAL_PROPORTIONS
15391553
);
15401554
DriverContext driverContext = driverContext();
15411555
List<Page> results = drive(

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/LookupFromIndexIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ private void runLookup(DataType keyType, PopulateIndices populateIndices) throws
205205
List.of(new ValuesSourceReaderOperator.ShardContext(searchContext.getSearchExecutionContext().getIndexReader(), () -> {
206206
throw new IllegalStateException("can't load source here");
207207
})),
208-
0
208+
0,
209+
0.1
209210
);
210211
CancellableTask parentTask = new EsqlQueryTask(
211212
1,

0 commit comments

Comments
 (0)