Skip to content

First and Last Accumulators should update with state row excluding is_set flag #7567

@viirya

Description

@viirya

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 #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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions