-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[fix](be) Validate aggregate state parameters and preserve nullable layouts #67805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
HappenLee
wants to merge
16
commits into
apache:master
Choose a base branch
from
HappenLee:fix-topn-agg-state-parameters
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
58e47d9
[fix](be) Reject incompatible aggregate state parameters
HappenLee f33cb43
[fix](be) Ignore collect states with negative limits during merge
HappenLee d7a9d5e
[fix](fe) Require a constant collect_set limit
HappenLee afd1b80
[doc](be) Clarify EMA zero half-decay state semantics
HappenLee 9fb011e
[fix](be) Reject NaN EMA half-decay on state and result output
HappenLee 349ed2a
[refactor](be) Exclude linear_histogram from aggregate state validation
HappenLee 243c526
[fix](fe) Reject NaN percentile reservoir levels
HappenLee fdf2a52
[fix](be) Validate configured eventless sequence states
HappenLee a8b018b
[fix](fe) Require constant window funnel parameters
HappenLee 21892a5
[fix](be) Preserve configuration in eventless funnel states
HappenLee 3d60517
[doc](be) Clarify empty reservoir state merge semantics
HappenLee 1ba9b39
[fix](be) Unify configured-empty aggregate state semantics
HappenLee 822f212
[fix](be) Ignore parameters of non-contributing aggregate states
HappenLee 7e1a126
[fix](fe) Preserve aggregate state layouts across rewrites
HappenLee c3da103
[fix](be) Restore compact collect state initialization
HappenLee bf483fc
[fix](be) Return empty arrays for sample-free approximate percentiles
HappenLee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Cover the multi-distinct AggState wrapper
This validation runs only when the nested
group_concatstate is merged.multi_distinct_group_concat_stateremains supported, butAggregateFunctionDistinct::merge()unions only its outer argument set and finalization later calls nestedadd(); it never invokes this method. States with','and';'therefore merge silently and whichever tuple is iterated first selects the separator for all values. Either make that wrapper unsupported for AggState or preserve and validate its separator before unioning, with both operand orders in regression coverage.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing out this gap. The distinct wrapper merges and serializes its outer argument set, then feeds the reconstructed arguments to the nested aggregate via add() during finalization. It does not call the nested group_concat merge(), so the separator check added here does not cover this path.
We will defer this issue to a separate follow-up PR. Preserving support requires the wrapper to retain and validate its configuration before combining argument sets; alternatively, restricting AggState support needs consistent handling across function combinators, DDL, and existing stored states. We do not want to fold that broader change into this PR.
No implementation change for this issue is included here. Leaving this thread unresolved to make the remaining gap explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed to address this in a follow-up. We have confirmed the gap in both
_stateand_combine, including_unionfollowed by_merge: states with different separators merge silently, and equal values with different separators can appear twice in the result.The fix needs consistent configuration validation in the distinct wrapper across merging, serialization and reset. We will handle that separately and keep this thread open to track the remaining work.