Repository navigation
Conversation
|
Workflow [PR], commit [cfd95ad] Summary: ❌
AI ReviewSummaryThis PR replaces the broad empty-parameter tolerance in Findings
Tests
Final VerdictStatus: Minimum required action: preserve or explicitly allow the outer parameters for |
There was a problem hiding this comment.
Pull request overview
Replaces a permissive function->getParameters().empty() tolerance in the aggregate function factory's invariant check with an explicit allow-list of known aggregation functions that drop their parameters, making the workaround visible and easier to remove later. Also fixes a minor typo in a comment.
Changes:
- Introduces a
dropsParameters()helper containing an explicit set of four aggregate function names known to drop parameters. - Updates two
chassertinvariant checks inAggregateFunctionFactory::getImplto use the allow-list instead of accepting any empty-parameter result. - Fixes a typo ("even of" → "even if") in
FieldVisitorToCastedLiteral.cpp.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/AggregateFunctions/AggregateFunctionFactory.cpp | Adds explicit allow-list of parameter-dropping aggregates and tightens invariant checks. |
| src/Common/FieldVisitorToCastedLiteral.cpp | Fixes a typo in a code comment. |
6a1c85f to
21f8d3f
Compare
21f8d3f to
8b889fd
Compare
8b889fd to
cfd95ad
Compare
| /// Same invariant as above. | ||
| chassert(combined_function && (combined_function->getParameters().empty() || combined_function->getParameters() == parameters), | ||
| "function->getParameters() must equal the parameters passed to the factory"); | ||
| chassert(combined_function && combined_function->getParameters() == parameters, |
There was a problem hiding this comment.
The new combinator assertion is too strong for Map wrapped aggregates that are on the drop list. For example, groupArrayMovingSumMap(3)(m) goes through the Map combinator with outer parameters == [3]; the nested groupArrayMovingSum is allowed above to return empty getParameters, and AggregateFunctionMap initializes its own parameters from nested->getParameters, so combined_function->getParameters is empty here and this chassert fires in debug/ASan builds for a valid aggregate. Please preserve the outer params in AggregateFunctionMap (or otherwise special-case this explicit drop-list path) before making the combined-function check strict.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 13/14 (92.86%) | Lost baseline coverage: none · Uncovered code |
|
Dear @vitlibar, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message. |
|
Dear @vitlibar, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Make the list of aggregation functions dropping their parameters explicit
Follow-up to #104812 (comment)