Skip to content

Documentation and test coverage for the size of the ARRAY_AGG() partial state - #4597

Open
robert-brunel wants to merge 1 commit into
mainfrom
apple/robert-brunel/array_agg-limit-1
Open

Documentation and test coverage for the size of the ARRAY_AGG() partial state#4597
robert-brunel wants to merge 1 commit into
mainfrom
apple/robert-brunel/array_agg-limit-1

Conversation

@robert-brunel

Copy link
Copy Markdown
Contributor

ARRAY_AGG() comes with inherent caveats around the size of its partial state, which deserve some dedicated tests and a note in the SQL Reference. The size of the state is O(N), since it holds every element collected so far, and on a mid-group stop it is serialized into the continuation that is handed to the client. Nothing in either the Record Layer or FDB limits the size.

  • Document the group-size caveats in the SQL Reference.
  • Add a block to array-agg-tests.yamsql that covers a fairly large group end to end, and a second one that exercises the continuation carrying the partial state.
  • Add a partialAggregateArrayAggLargeGroup() test to pin the per-element cost against a potential blowup, and to check that a group resumed from a mid-group continuation completes with every element present exactly once.

@robert-brunel robert-brunel self-assigned this Sep 8, 2026
@robert-brunel robert-brunel added testing improvement Change that improves our testing documentation Documentation change labels Sep 8, 2026
…tial state

`ARRAY_AGG()` has some inherent caveats around its partial state, which deserve dedicated tests and a note in the SQL Reference. The size of the state is O(N), since it holds every element collected so far, and on a mid-group stop it is serialized into the continuation that is handed to the client. Nothing in either the Record Layer or FDB limits the size.

* Document the group-size caveats in the SQL Reference.
* Add a block to `array-agg-tests.yamsql` that covers a fairly large group end to end, and a second one that exercises the continuation carrying the partial state.
* Add a `partialAggregateArrayAggLargeGroup()` test to pin the per-element cost against a potential blowup, and to check that a group resumed from a mid-group continuation completes with every element present exactly once.
@robert-brunel
robert-brunel force-pushed the apple/robert-brunel/array_agg-limit-1 branch from 18cabca to d2a3607 Compare September 8, 2026 18:57
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

📊 Metrics Diff Analysis Report

Summary

  • New queries: 0
  • Dropped queries: 0
  • Plan changed + metrics changed: 0
  • Plan unchanged + metrics changed: 0
ℹ️ About this analysis

This automated analysis compares query planner metrics between the base branch and this PR. It categorizes changes into:

  • New queries: Queries added in this PR
  • Dropped queries: Queries removed in this PR. These should be reviewed to ensure we are not losing coverage.
  • Plan changed + metrics changed: The query plan has changed along with planner metrics.
  • Metrics only changed: Same plan but different metrics

The last category in particular may indicate planner regressions that should be investigated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation change testing improvement Change that improves our testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant