You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE TABLE test
(
`time` DateTime
)
ENGINE = MergeTree
ORDER BY time
SELECT *
FROM
(
SELECT
toUInt64(time) AS time,
toHour(test.time)
FROM test
)
ORDER BY time ASC
Query id: b195d950-1ccb-4895-9562-b04341889128
0 rows in set. Elapsed: 0.005 sec.
Received exception from server (version 22.6.1):
Code: 352. DB::Exception: Received from localhost:9000. DB::Exception: Block structure mismatch in (columns with identical name must have identical structure) stream: different types:
time DateTime UInt32(size = 0)
time UInt64 UInt64(size = 0). (AMBIGUOUS_COLUMN_NAME)
It does not work with "WITH" either:
WITH subquery AS (
SELECT
toUInt64(time) AS time,
toHour(test.time)
FROM test
)
SELECT *
FROM subquery
ORDER BY subquery.time ASC
It starts working if I add one more order by:
SELECT *
FROM
(
SELECT
toUInt64(time) AS time,
toHour(test.time) AS hour
FROM test
)
ORDER BY time ASC, hour
SELECT *
FROM
(
SELECT
toUInt64(time) AS time,
toHour(test.time)
FROM test
)
ORDER BY time ASC
SETTINGS allow_experimental_analyzer = 1
Query id: c403e73f-810e-4418-9218-6e403b4fb0c9
Ok.
Activity
den-crane commentedon Apr 1, 2023
works with analyzer
Close #48308