Fix *If combinator with unary function and Nullable types#18806
Merged
alexey-milovidov merged 1 commit intoClickHouse:masterfrom Jan 7, 2021
Merged
Fix *If combinator with unary function and Nullable types#18806alexey-milovidov merged 1 commit intoClickHouse:masterfrom
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
Conversation
sumIf(Nullable()) and similar unary functions (unary w/o If combinator) was working incorrectly, since it returns "sum" from the getName() helper, and so distributed query processing fails. The problem is in the optimization in AggregateFunctionIfNullUnary::add() for the unary functions. It pass only one column to write result to, instead of all passed arguments + result columns. While AggregateFunctionIf::add() assumes that it accepts arguments + result columns, and use last column as a result. Introduced-in: ClickHouse#16610 Fixes: ClickHouse#18210
alexey-milovidov
approved these changes
Jan 7, 2021
This was referenced Jan 7, 2021
Merged
Merged
Merged
robot-clickhouse
pushed a commit
that referenced
this pull request
Jan 7, 2021
alexey-milovidov
added a commit
that referenced
this pull request
Jan 10, 2021
Backport #18806 to 20.12: Fix *If combinator with unary function and Nullable types
alexey-milovidov
added a commit
that referenced
this pull request
Jan 10, 2021
Backport #18806 to 20.11: Fix *If combinator with unary function and Nullable types
alexey-milovidov
added a commit
that referenced
this pull request
Jan 10, 2021
Backport #18806 to 20.10: Fix *If combinator with unary function and Nullable types
alexey-milovidov
added a commit
that referenced
this pull request
Jan 15, 2021
Fix *If combinator with unary function and Nullable types
This was referenced Feb 17, 2021
robot-clickhouse
pushed a commit
that referenced
this pull request
Feb 18, 2021
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix *If combinator with unary function and Nullable types
Detailed description / Documentation draft:
sumIf(Nullable()) and similar unary functions (unary w/o If combinator)
was working incorrectly, since it returns "sum" from the getName()
helper, and so distributed query processing fails.
The problem is in the optimization in
AggregateFunctionIfNullUnary::add() for the unary functions. It pass
only one column to write result to, instead of all passed arguments +
result columns.
While AggregateFunctionIf::add() assumes that it accepts arguments +
result columns, and use last column as a result.
Introduced-in: #16610
Fixes: #18210
Cc: @zhang2014