Skip to content

bugfix: fix streaming CTE/subquery + aggregation returning empty results#1132

Merged
yokofly merged 1 commit intodevelopfrom
streaming-cte-aggregation
Mar 17, 2026
Merged

bugfix: fix streaming CTE/subquery + aggregation returning empty results#1132
yokofly merged 1 commit intodevelopfrom
streaming-cte-aggregation

Conversation

@yokofly
Copy link
Copy Markdown
Collaborator

@yokofly yokofly commented Mar 17, 2026

Summary

  • When a bounded streaming input (e.g. CTE with LIMIT) finished before any periodic watermark fired, AggregatingTransform::prepare() would close the output without finalizing buffered aggregation state — resulting in silently empty results.
  • Fix: inject a synthetic watermark when the input finishes with accumulated but un-finalized rows, triggering the existing finalization path.
  • Added regression test 98468_streaming_cte_limit_aggregation covering CTE streaming + count(), GROUP BY, subquery, and non-aggregate passthrough.

@yokofly yokofly merged commit bfb1ded into develop Mar 17, 2026
6 of 10 checks passed
@yokofly yokofly deleted the streaming-cte-aggregation branch March 17, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant