TinyMurky commented on code in PR #25497:
URL: https://github.com/apache/datafusion/pull/25497#discussion_r4111992703
##########
datafusion/functions-aggregate/src/array_agg.rs:
##########
@@ -1531,11 +1539,37 @@ impl OrderSensitiveArrayAggAccumulator {
}
let start = self.entries.len();
- let batch_idx = self.batches.len();
- self.batches.push(values);
- self.entries.extend(
- (0..row_count).map(|row_idx| OrderedArrayAggEntry { batch_idx,
row_idx }),
- );
+ let (batch_idx, row_offset) = match self.batches.last() {
+ Some(last_batch)
+ if last_batch.len() + row_count <=
ORDERED_ARRAY_AGG_COALESCE_ROWS
+ && last_batch.get_buffer_memory_size()
+ + values.get_buffer_memory_size()
+ <= ORDERED_ARRAY_AGG_COALESCE_BYTES =>
+ {
+ let merged =
Review Comment:
I have edited the code as below for seperating `Utf8View`/`BinaryView` for
one more `compact_payload`
https://github.com/apache/datafusion/blob/19564841c0df254acc31ccced5142733c3157059/datafusion/functions-aggregate/src/array_agg.rs#L1574-L1589
And I added a new `BinaryView` test to test if it can be coalesced same as
`Utf8View`
https://github.com/apache/datafusion/blob/19564841c0df254acc31ccced5142733c3157059/datafusion/functions-aggregate/src/array_agg.rs#L3158-L3201
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]