Repository navigation
Normalize named tuple arguments in agg states - #70853
Conversation
|
This is an automated comment for commit 2393d2f with description of existing statuses. It's updated for the latest CI running ✅ Click here to open a full report in a separate page Successful checks
|
|
@serxa It would be better to wait for @alexey-milovidov 's input before merging this PR, as it breaks compatibility for certain |
|
I don't understand why we are ok with breaking the INSERT behaviour, from a expected one to a completely unexpected one. In the original message: Without this setting: I would expect it to either have the same behaviour as before and match columns in order, or throw because the columns don't match, but inserting default values is totally unexpected. |
| M(Bool, enable_named_columns_in_function_tuple, false, R"( | ||
| M(Bool, enable_named_columns_in_function_tuple, true, R"( | ||
| Generate named tuples in function tuple() when all names are unique and can be treated as unquoted identifiers. | ||
| Beware that this setting might currently result in broken queries. It's not recommended to use in production |
There was a problem hiding this comment.
We enabled it while there is still broken behaviour, or at least I understand so (#70853 (comment)), and the description still says it's broken and not to use it in production.
|
@amosbird, please edit the inline documentation accordingly. |
@Algunenano The "unexpected" behavior originates from the different conversion rules applied to named and unnamed tuples: ClickHouse/src/Functions/FunctionsConversion.cpp Lines 3727 to 3765 in 4c0ce6a To my knowledge this behavior difference between named and unnamed tuple conversions is not explicitly documented in ClickHouse, nor is it standardized in SQL specifications. In order to help users (who rely on such implementation defined behavior) catch potential data loss issues during INSERT-SELECT, we can introduce a |
|
If we enable it by default - ok, otherwise don't bother. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Normalize named tuple arguments in aggregation states. This fixes #69732 .
This PR also re-enables
enable_named_columns_in_function_tuple, as all known bugs related to it have been resolved. The only remaining exception is issue #70830, which simplifies to the following scenario:Since ClickHouse does not support inserting tuples with different names (e.g.,
Tuple(a2 int, b2 int)) into a tuple structure defined asTuple(a int, b int), enablingenable_named_columns_in_function_tuplewould naturally break this compatibility.