viirya opened a new issue, #7567: URL: https://github.com/apache/arrow-datafusion/issues/7567
### Describe the bug First and Last Accumulators would update itself from first/last row during merging state batches (e.g., merge_batch). However, currently it takes the whole state row (which includes is_set flag) into update_with_new_row which in turn takes all columns except for first one into orderings (so existing is_set is put there) and adds is_set flag. This ends with double is_set flags if state is called on the accumulators which have merged state batches. Normally this is not an issue because state is not called once aggregation enters the stage of merging state batches. But in https://github.com/apache/arrow-datafusion/pull/7400, where spilling happens to call state on such accumulators to get its states and spill into disk. This leads to a hacky fix there and we should fix these two accumulators accordingly to avoid the hacky way. ### To Reproduce _No response_ ### Expected behavior _No response_ ### Additional context _No response_ -- 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]
