diff --git a/muted-tests.yml b/muted-tests.yml index 696a6c62fe6c8..b7d5f37de9035 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -426,9 +426,6 @@ tests: - class: org.elasticsearch.xpack.esql.action.CrossClusterQueryWithPartialResultsIT method: testOneRemoteClusterPartial issue: https://github.com/elastic/elasticsearch/issues/124055 -- class: org.elasticsearch.compute.aggregation.SampleDoubleAggregatorFunctionTests - method: testSimpleWithCranky - issue: https://github.com/elastic/elasticsearch/issues/128024 - class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT method: test {lookup-join.MvJoinKeyOnTheLookupIndex ASYNC} issue: https://github.com/elastic/elasticsearch/issues/128030 diff --git a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleBooleanAggregator.java b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleBooleanAggregator.java index e0388c216ae56..7ef2b2c52f685 100644 --- a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleBooleanAggregator.java +++ b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleBooleanAggregator.java @@ -96,8 +96,10 @@ private static Block stripWeights(DriverContext driverContext, Block block) { if (block.areAllValuesNull()) { return block; } - BytesRefBlock bytesRefBlock = (BytesRefBlock) block; - try (BooleanBlock.Builder booleanBlock = driverContext.blockFactory().newBooleanBlockBuilder(bytesRefBlock.getPositionCount())) { + try ( + BytesRefBlock bytesRefBlock = (BytesRefBlock) block; + BooleanBlock.Builder booleanBlock = driverContext.blockFactory().newBooleanBlockBuilder(bytesRefBlock.getPositionCount()) + ) { BytesRef scratch = new BytesRef(); for (int position = 0; position < block.getPositionCount(); position++) { if (bytesRefBlock.isNull(position)) { @@ -119,7 +121,6 @@ private static Block stripWeights(DriverContext driverContext, Block block) { } } } - block.close(); return booleanBlock.build(); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleBytesRefAggregator.java b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleBytesRefAggregator.java index 2291e759d9677..c9e42350dd060 100644 --- a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleBytesRefAggregator.java +++ b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleBytesRefAggregator.java @@ -96,8 +96,10 @@ private static Block stripWeights(DriverContext driverContext, Block block) { if (block.areAllValuesNull()) { return block; } - BytesRefBlock bytesRefBlock = (BytesRefBlock) block; - try (BytesRefBlock.Builder BytesRefBlock = driverContext.blockFactory().newBytesRefBlockBuilder(bytesRefBlock.getPositionCount())) { + try ( + BytesRefBlock bytesRefBlock = (BytesRefBlock) block; + BytesRefBlock.Builder BytesRefBlock = driverContext.blockFactory().newBytesRefBlockBuilder(bytesRefBlock.getPositionCount()) + ) { BytesRef scratch = new BytesRef(); for (int position = 0; position < block.getPositionCount(); position++) { if (bytesRefBlock.isNull(position)) { @@ -119,7 +121,6 @@ private static Block stripWeights(DriverContext driverContext, Block block) { } } } - block.close(); return BytesRefBlock.build(); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleDoubleAggregator.java b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleDoubleAggregator.java index 6a5a33bb06255..f526c54c6ddff 100644 --- a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleDoubleAggregator.java +++ b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleDoubleAggregator.java @@ -96,8 +96,10 @@ private static Block stripWeights(DriverContext driverContext, Block block) { if (block.areAllValuesNull()) { return block; } - BytesRefBlock bytesRefBlock = (BytesRefBlock) block; - try (DoubleBlock.Builder doubleBlock = driverContext.blockFactory().newDoubleBlockBuilder(bytesRefBlock.getPositionCount())) { + try ( + BytesRefBlock bytesRefBlock = (BytesRefBlock) block; + DoubleBlock.Builder doubleBlock = driverContext.blockFactory().newDoubleBlockBuilder(bytesRefBlock.getPositionCount()) + ) { BytesRef scratch = new BytesRef(); for (int position = 0; position < block.getPositionCount(); position++) { if (bytesRefBlock.isNull(position)) { @@ -119,7 +121,6 @@ private static Block stripWeights(DriverContext driverContext, Block block) { } } } - block.close(); return doubleBlock.build(); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleIntAggregator.java b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleIntAggregator.java index 762367387bc27..d6172006e46df 100644 --- a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleIntAggregator.java +++ b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleIntAggregator.java @@ -96,8 +96,10 @@ private static Block stripWeights(DriverContext driverContext, Block block) { if (block.areAllValuesNull()) { return block; } - BytesRefBlock bytesRefBlock = (BytesRefBlock) block; - try (IntBlock.Builder intBlock = driverContext.blockFactory().newIntBlockBuilder(bytesRefBlock.getPositionCount())) { + try ( + BytesRefBlock bytesRefBlock = (BytesRefBlock) block; + IntBlock.Builder intBlock = driverContext.blockFactory().newIntBlockBuilder(bytesRefBlock.getPositionCount()) + ) { BytesRef scratch = new BytesRef(); for (int position = 0; position < block.getPositionCount(); position++) { if (bytesRefBlock.isNull(position)) { @@ -119,7 +121,6 @@ private static Block stripWeights(DriverContext driverContext, Block block) { } } } - block.close(); return intBlock.build(); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleLongAggregator.java b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleLongAggregator.java index 1cb5931575513..cd97db7155d58 100644 --- a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleLongAggregator.java +++ b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleLongAggregator.java @@ -96,8 +96,10 @@ private static Block stripWeights(DriverContext driverContext, Block block) { if (block.areAllValuesNull()) { return block; } - BytesRefBlock bytesRefBlock = (BytesRefBlock) block; - try (LongBlock.Builder longBlock = driverContext.blockFactory().newLongBlockBuilder(bytesRefBlock.getPositionCount())) { + try ( + BytesRefBlock bytesRefBlock = (BytesRefBlock) block; + LongBlock.Builder longBlock = driverContext.blockFactory().newLongBlockBuilder(bytesRefBlock.getPositionCount()) + ) { BytesRef scratch = new BytesRef(); for (int position = 0; position < block.getPositionCount(); position++) { if (bytesRefBlock.isNull(position)) { @@ -119,7 +121,6 @@ private static Block stripWeights(DriverContext driverContext, Block block) { } } } - block.close(); return longBlock.build(); } } diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/X-SampleAggregator.java.st b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/X-SampleAggregator.java.st index f13857002e848..90539cb9ecf68 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/X-SampleAggregator.java.st +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/X-SampleAggregator.java.st @@ -96,8 +96,10 @@ class Sample$Type$Aggregator { if (block.areAllValuesNull()) { return block; } - BytesRefBlock bytesRefBlock = (BytesRefBlock) block; - try ($Type$Block.Builder $type$Block = driverContext.blockFactory().new$Type$BlockBuilder(bytesRefBlock.getPositionCount())) { + try ( + BytesRefBlock bytesRefBlock = (BytesRefBlock) block; + $Type$Block.Builder $type$Block = driverContext.blockFactory().new$Type$BlockBuilder(bytesRefBlock.getPositionCount()) + ) { BytesRef scratch = new BytesRef(); for (int position = 0; position < block.getPositionCount(); position++) { if (bytesRefBlock.isNull(position)) { @@ -119,7 +121,6 @@ class Sample$Type$Aggregator { } } } - block.close(); return $type$Block.build(); } }