Skip to content

Support array_agg as a sliding window aggregate by implementing retract_batch #21957

@FjodorGit

Description

@FjodorGit

Is your feature request related to a problem or challenge?

array_agg currently works as a window aggregate for ever-expanding frames such as ROW BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, but it cannot be used with bounded/sliding frames because its accumulator does not implement retract_batch.

Describe the solution you'd like

It would be useful to implement retract_batch for at least the non-DISTINCT array_agg accumulator such that at least such a query would be possible

SELECT array_agg(x) OVER (
	ORDER BY t 
	ROWS BETWEEN 1 PRECEDING AND CURRENT ROW
)
FROM ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions