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
{{ message }}
Repository navigation
Column taken from wrong table in a left join, when column name has special character (dot). #39634
In the following code example I try to join two similar tables, and cherry pick the columns that should be selected. Unfortunately, in this case the columns include a . (dot) as part of its name. Clickhouse chooses the wrong table for this column even though its explicitly stated from which table it should be taken. So in the following code i get a 1 instead of the 2. If I use quotes around the column name like in the second code block it works as intended. But in the first case, I would expect to get an error or a warning message at least. Is absolutely counterintuitive, that it would take it from test1 when running this code.
Clickhouse version: 21.10.2.15
CREATE TABLE qa.test1
(
`pk` String,
`x.y` Decimal(18, 4)
)
ENGINE = MergeTree()
ORDER BY (pk);
CREATE TABLE qa.test2
(
`pk` String,
`x.y` Decimal(18, 4)
)
ENGINE = MergeTree()
ORDER BY (pk);
INSERT INTO qa.test1 SELECT 'pk1', 1;
INSERT INTO qa.test2 SELECT 'pk1', 2;
SELECT t1.pk, t2.x.y
FROM qa.test1 t1
LEFT JOIN qa.test2 t2
on t1.pk = t2.pk;
SELECT t1.pk, t2.`x.y`
FROM qa.test1 t1
LEFT JOIN qa.test2 t2
on t1.pk = t2.pk;
Activity
den-crane commentedon Jul 27, 2022
den-crane commentedon Jul 27, 2022
related to "nightmare" #23194
Close: #39634