Skip to content

Commit d482cd2

Browse files
committed
Fixed BlockTypeRandomizer BigArrayBlock generation
1 parent 6c65744 commit d482cd2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/data/BlockTypeRandomizer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static IntBlock randomizeBlockType(IntBlock block) {
7777
}
7878

7979
int[] values = new int[totalValues];
80-
for (int i = 0; i < values.length; i++) {
80+
for (int i = 0; i < totalValues; i++) {
8181
values[i] = block.getInt(i);
8282
}
8383

@@ -93,7 +93,7 @@ public static IntBlock randomizeBlockType(IntBlock block) {
9393
}
9494

9595
var intArray = blockFactory.bigArrays().newIntArray(totalValues);
96-
for (int i = 0; i < block.getPositionCount(); i++) {
96+
for (int i = 0; i < totalValues; i++) {
9797
intArray.set(i, block.getInt(i));
9898
}
9999

0 commit comments

Comments
 (0)