mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 21:12:28 +00:00
67 lines
1.3 KiB
Plaintext
67 lines
1.3 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
|
|
-- thankfully JSONExtract() keeps them
|
|
Row 1:
|
|
──────
|
|
x.key: value
|
|
Row 1:
|
|
──────
|
|
x.key: value
|