v.24.9Backward Incompatible Changes

Support for Named Tuples in Expressions and Potential Incompatibility with Prior Versions

Expressions like a[b].c are supported for named tuples, as well as named subscripts from arbitrary expressions, e.g., expr().name. This is useful for processing JSON. This closes #54965. In previous versions, an expression of form expr().name was parsed as tupleElement(expr(), name), and the query analyzer was searching for a column name rather than for the corresponding tuple element; while in the new version, it is changed to tupleElement(expr(), 'name'). In most cases, the previous version was not working, but it is possible to imagine a very unusual scenario when this change could lead to incompatibility: if you stored names of tuple elements in a column or an alias, that was named differently than the tuple element's name: SELECT 'b' AS a, CAST([tuple(123)] AS 'Array(Tuple(b UInt8))') AS t, t[1].a. It is very unlikely that you used such queries, but we still have to mark this change as potentially backward incompatible. #68435 (Alexey Milovidov).