Add setting aggregate_functions_null_for_empty#16123
Add setting aggregate_functions_null_for_empty#16123alexey-milovidov merged 5 commits intoClickHouse:masterfrom
aggregate_functions_null_for_empty#16123Conversation
|
It leads to 6x performance drop even if the argument is not nullable: |
…nc-setting-null-for-empty
|
Please cherry-pick this commit: c7618ea |
|
It's tricky that the function |
|
It is controlled by |
So, what is the best way to resolve this? |
|
Look at the function properties (from AggregateFunctionFactory) and don't rewrite functions that should not return NULL. |
|
@ucasfl We forgot about one little thing... For -State and -Merge functions we need to add -OrNull before, not after... |
Maybe not only -State and -Merge, but also -If, -MergeState? |
|
Yes, About |
SELECT sumIfOrNull(1, 0)
Query id: cfeae055-758d-4482-9cda-0ebac2bcca5f
┌─sumIfOrNull(1, 0)─┐
│ 0 │
└───────────────────┘
SELECT sumOrNullIf(1, 0)
Query id: eb9b740c-155e-46e4-9d44-5d67e6d2fb25
┌─sumOrNullIf(1, 0)─┐
│ ᴺᵁᴸᴸ │
└───────────────────┘
It's different. |
|
And there may be multiple combinators in an aggregate function, such as |
fix Aggregation Function not found error after #16123
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add setting
aggregate_functions_null_for_empty, this option will rewrite all aggregate functions in a query, adding -OrNull suffix to them. fix 10273Detailed description / Documentation draft:
...
By adding documentation, you'll allow users to try your new feature immediately, not when someone else will have time to document it later. Documentation is necessary for all features that affect user experience in any way. You can add brief documentation draft above, or add documentation right into your patch as Markdown files in docs folder.
If you are doing this for the first time, it's recommended to read the lightweight Contributing to ClickHouse Documentation guide first.
Information about CI checks: https://clickhouse.tech/docs/en/development/continuous-integration/