From 4d9084dd9536b63bac3a65d583f1f989912933c0 Mon Sep 17 00:00:00 2001 From: Ignacio Vera Date: Mon, 30 Sep 2024 22:45:44 +0200 Subject: [PATCH] Fix IOOBE in BigArrayVectorTests (#113779) (#113819) --- .../compute/data/BigArrayVectorTests.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/data/BigArrayVectorTests.java b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/data/BigArrayVectorTests.java index aab8b86f9b795..21a7615491e03 100644 --- a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/data/BigArrayVectorTests.java +++ b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/data/BigArrayVectorTests.java @@ -64,8 +64,8 @@ public void testBoolean() throws IOException { if (positionCount > 1) { assertLookup( vector.asBlock(), - positions(blockFactory, 1, 2, new int[] { 1, 2 }), - List.of(List.of(values[1]), List.of(values[2]), List.of(values[1], values[2])) + positions(blockFactory, 0, 1, new int[] { 0, 1 }), + List.of(List.of(values[0]), List.of(values[1]), List.of(values[0], values[1])) ); } assertLookup(vector.asBlock(), positions(blockFactory, positionCount + 1000), singletonList(null)); @@ -110,8 +110,8 @@ public void testInt() throws IOException { if (positionCount > 1) { assertLookup( vector.asBlock(), - positions(blockFactory, 1, 2, new int[] { 1, 2 }), - List.of(List.of(values[1]), List.of(values[2]), List.of(values[1], values[2])) + positions(blockFactory, 0, 1, new int[] { 0, 1 }), + List.of(List.of(values[0]), List.of(values[1]), List.of(values[0], values[1])) ); } assertLookup(vector.asBlock(), positions(blockFactory, positionCount + 1000), singletonList(null)); @@ -152,8 +152,8 @@ public void testLong() throws IOException { if (positionCount > 1) { assertLookup( vector.asBlock(), - positions(blockFactory, 1, 2, new int[] { 1, 2 }), - List.of(List.of(values[1]), List.of(values[2]), List.of(values[1], values[2])) + positions(blockFactory, 0, 1, new int[] { 0, 1 }), + List.of(List.of(values[0]), List.of(values[1]), List.of(values[0], values[1])) ); } assertLookup(vector.asBlock(), positions(blockFactory, positionCount + 1000), singletonList(null)); @@ -192,8 +192,8 @@ public void testDouble() throws IOException { if (positionCount > 1) { assertLookup( vector.asBlock(), - positions(blockFactory, 1, 2, new int[] { 1, 2 }), - List.of(List.of(values[1]), List.of(values[2]), List.of(values[1], values[2])) + positions(blockFactory, 0, 1, new int[] { 0, 1 }), + List.of(List.of(values[0]), List.of(values[1]), List.of(values[0], values[1])) ); } assertLookup(vector.asBlock(), positions(blockFactory, positionCount + 1000), singletonList(null));