Skip to content

Commit e352d2c

Browse files
jan-elasticelasticsearchmachine
andauthored
Fix memory tracking of ES|QL sample agg (#128467)
* Fix memory tracking of ES|QL sample agg * [CI] Auto commit changes from spotless * polish code --------- Co-authored-by: elasticsearchmachine <[email protected]>
1 parent 7bcbca1 commit e352d2c

File tree

7 files changed

+24
-21
lines changed

7 files changed

+24
-21
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,6 @@ tests:
426426
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryWithPartialResultsIT
427427
method: testOneRemoteClusterPartial
428428
issue: https://github.com/elastic/elasticsearch/issues/124055
429-
- class: org.elasticsearch.compute.aggregation.SampleDoubleAggregatorFunctionTests
430-
method: testSimpleWithCranky
431-
issue: https://github.com/elastic/elasticsearch/issues/128024
432429
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
433430
method: test {lookup-join.MvJoinKeyOnTheLookupIndex ASYNC}
434431
issue: https://github.com/elastic/elasticsearch/issues/128030

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleBooleanAggregator.java

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleBytesRefAggregator.java

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleDoubleAggregator.java

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleIntAggregator.java

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/SampleLongAggregator.java

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/X-SampleAggregator.java.st

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ class Sample$Type$Aggregator {
9696
if (block.areAllValuesNull()) {
9797
return block;
9898
}
99-
BytesRefBlock bytesRefBlock = (BytesRefBlock) block;
100-
try ($Type$Block.Builder $type$Block = driverContext.blockFactory().new$Type$BlockBuilder(bytesRefBlock.getPositionCount())) {
99+
try (
100+
BytesRefBlock bytesRefBlock = (BytesRefBlock) block;
101+
$Type$Block.Builder $type$Block = driverContext.blockFactory().new$Type$BlockBuilder(bytesRefBlock.getPositionCount())
102+
) {
101103
BytesRef scratch = new BytesRef();
102104
for (int position = 0; position < block.getPositionCount(); position++) {
103105
if (bytesRefBlock.isNull(position)) {
@@ -119,7 +121,6 @@ class Sample$Type$Aggregator {
119121
}
120122
}
121123
}
122-
block.close();
123124
return $type$Block.build();
124125
}
125126
}

0 commit comments

Comments
 (0)