Skip to content

Commit a193f87

Browse files
committed
explain
1 parent 3673249 commit a193f87

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/lucene/ValuesSourceReaderOperator.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,13 +557,20 @@ protected Status status(long processNanos, int pagesProcessed, long rowsReceived
557557
return new Status(new TreeMap<>(readersBuilt), processNanos, pagesProcessed, rowsReceived, rowsEmitted, valuesLoaded);
558558
}
559559

560-
private void sanityCheckBlock(Object loader, int expectedPositions, Block block, int f) {
560+
/**
561+
* Quick checks for on the loaded block to make sure it looks reasonable.
562+
* @param loader the object that did the loading - we use it to make error messages if the block is busted
563+
* @param expectedPositions how many positions the block should have - it's as many as the incoming {@link Page} has
564+
* @param block the block to sanity check
565+
* @param field offset into the {@link #fields} array for the block being loaded
566+
*/
567+
private void sanityCheckBlock(Object loader, int expectedPositions, Block block, int field) {
561568
if (block.getPositionCount() != expectedPositions) {
562569
throw new IllegalStateException(loader + ": " + block + " didn't have [" + expectedPositions + "] positions");
563570
}
564-
if (block.elementType() != ElementType.NULL && block.elementType() != fields[f].info.type) {
571+
if (block.elementType() != ElementType.NULL && block.elementType() != fields[field].info.type) {
565572
throw new IllegalStateException(
566-
loader + ": " + block + "'s element_type [" + block.elementType() + "] NOT IN (NULL, " + fields[f].info.type + ")"
573+
loader + ": " + block + "'s element_type [" + block.elementType() + "] NOT IN (NULL, " + fields[field].info.type + ")"
567574
);
568575
}
569576
}

0 commit comments

Comments
 (0)