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 repl_tbl
(
`key` UInt32,
`val_1` UInt32,
`val_2` String,
`val_3` String,
`val_4` String,
`val_5` UUID,
`ts` DateTime
)
ENGINE = ReplacingMergeTree(ts)
ORDER BY key
set prefer_column_name_to_alias=1;
WITH 10 as k SELECT k as key, * FROM repl_tbl WHERE key = k;
Received exception from server (version 21.5.1):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Unknown identifier: key there are columns: val_1, val_2, val_3, val_4, val_5, ts: While processing key = (10 AS k).
clickhouse-client --echo -n < 02702_alias_unknown_identifier.sql
CREATE TEMPORARY TABLE repl_tbl
(
`key` UInt32,
`val_1` UInt32,
`val_2` String,
`val_3` String,
`val_4` String,
`val_5` UUID,
`ts` DateTime
)
ENGINE = ReplacingMergeTree(ts)
ORDER BY `key`;
set prefer_column_name_to_alias = 1;
INSERT INTO repl_tbl (key) SELECT number FROM numbers(10);
WITH 10 as k SELECT k as key, * FROM repl_tbl WHERE key = k;
Received exception from server (version 23.3.1):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Unknown identifier: key; there are columns: val_1, val_2, val_3, val_4, val_5, ts: While processing key = (10 AS k). (UNKNOWN_IDENTIFIER)
(query: WITH 10 as k SELECT k as key, * FROM repl_tbl WHERE key = k;)
Activity
alexey-milovidov commentedon Oct 19, 2022
#23194
UnamedRus commentedon Mar 27, 2023
23.2
alexey-milovidov commentedon Mar 28, 2023
@UnamedRus, you forgot to add a test. Every fixed issue should be proven with a test. I will add it.
alexey-milovidov commentedon Mar 28, 2023
Not fixed:
Close: #23053