Skip to content

Commit 60d1bad

Browse files
committed
Explain more
1 parent 0478be2 commit 60d1bad

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ $endif$
301301
}
302302

303303
/*
304-
* Total the sign selected groups and turn them into a running count.
305-
* Negative counts are still unselected.
304+
* Total the selected groups and turn them into a running count.
305+
* Unselected groups will still have negative counts.
306306
*/
307307
int total = 0;
308308
for (int s = 0; s < selected.getPositionCount(); s++) {
@@ -317,6 +317,8 @@ $endif$
317317
* Build a list of ids to insert in order *and* convert the running
318318
* count in selectedCounts[group] into the end index in ids for each
319319
* group.
320+
* Here we use the negative counts to signal that a group hasn't been
321+
* selected and the id containing values for that group is ignored.
320322
*/
321323
idsSize = RamUsageEstimator.alignObjectSize(RamUsageEstimator.NUM_BYTES_ARRAY_HEADER + total * Integer.BYTES);
322324
blockFactory.adjustBreaker(idsSize);

0 commit comments

Comments
 (0)