Skip to content

[CH] Fix group limit first array result offset #12172

@lgbo-ustc

Description

@lgbo-ustc

Backend

CH (ClickHouse)

Bug description

cpp-ch/local-engine/AggregateFunctions/GroupLimitFunctions.cpp:138-145 reads ColumnArray offsets from an empty result column.

insertResultInto calls result_array_offsets.back() before pushing the first offset. A newly created aggregate result column has no offsets yet, so the first output row can access an empty container. The previous offset should be treated as 0 when result_array_offsets.empty().

Gluten version

No response

Spark version

None

Spark configurations

No response

System information

No response

Relevant logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions