mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-05 14:02:21 +00:00
71 lines
1.5 KiB
Plaintext
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 allow_experimental_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
|