ClickHouse/tests/queries/0_stateless/02890_untuple_column_names.reference
2024-08-05 15:29:14 +00:00

71 lines
1.5 KiB
Plaintext

-- tuple element alias
Row 1:
──────
tupleElement(CAST(tuple(1), 'Tuple(a Int)'), 1): 1
tupleElement(CAST(tuple('s'), 'Tuple(a String)'), 1): s
Row 1:
──────
tupleElement(CAST((1), 'Tuple(a Int)'), 'a'): 1
tupleElement(CAST(('s'), 'Tuple(a String)'), 'a'): s
Row 1:
──────
tupleElement(CAST((1), 'Tuple(a Int)'), 'a'): 1
tupleElement(CAST((1), 'Tuple(a Int)'), 'a'): 1
-- tuple element alias + untuple() alias
Row 1:
──────
x.a: 1
y.a: s
Row 1:
──────
x.a: 1
y.a: s
Row 1:
──────
x.a: 1
x.a: 1
-- untuple() alias
Row 1:
──────
x.1: 1
y.1: s
Row 1:
──────
x.1: 1
y.1: s
Row 1:
──────
x.1: 1
x.1: 1
-- no aliases
Row 1:
──────
tupleElement(CAST(tuple(1), 'Tuple(Int)'), 1): 1
tupleElement(CAST(tuple('s'), 'Tuple(String)'), 1): s
Row 1:
──────
tupleElement(CAST((1), 'Tuple(Int)'), '1'): 1
tupleElement(CAST(('s'), 'Tuple(String)'), '1'): s
Row 1:
──────
tupleElement(CAST((1), 'Tuple(Int)'), '1'): 1
tupleElement(CAST((1), 'Tuple(Int)'), '1'): 1
-- tuple() loses the column names (would be good to fix, see #36773)
Row 1:
──────
t.1: 1
Row 1:
──────
t.1: 1
-- tuple() with enable_named_columns_in_function_tuple = 1 and enable_analyzer = 1 keeps the column names
Row 1:
──────
t.a: 1
-- thankfully JSONExtract() keeps them
Row 1:
──────
x.key: value
Row 1:
──────
x.key: value