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
Not found column in block error in array join #37729
Describe what's wrong
join non first column of nest show Not found column in block error
How to reproduce
version: 22.3.2.1
CREATETABLEnested_test
(
s String,
nest Nested
(
x UInt64,
y UInt64
)
) ENGINE = MergeTree
ORDER BY s;
CREATETABLEjoin_test
(
id Int64,
y UInt64
)
ENGINE = MergeTree
ORDER BY id;
INSERT INTO nested_test
VALUES ('Hello', [1,2], [10,20]), ('World', [3,4,5], [30,40,50]), ('Goodbye', [], []);
INSERT INTO join_test
VALUES (1,1),(2,4),(3,20),(4,40);
when run the sql below, join on the first column of nest, there is no problem.
SELECT s
FROM nested_test t1 array join nest
inner join join_test t2 onnest.x=t2.y;
┌─s─────┐
│ Hello │
│ World │
└───────┘
but when join on the second column of nest, show error as blow.
SELECT s
FROM nested_test t1 array join nest
inner join join_test t2 onnest.y=t2.y;
Code: 10. DB::Exception: Received from host01:9000. DB::Exception: Not found column nest.yin block. There are only columns: s. (NOT_FOUND_COLUMN_IN_BLOCK)
milovidov-desktop :) SET allow_experimental_analyzer = 1
SET allow_experimental_analyzer = 1
Query id: 447e6686-689f-4978-a182-c1f6404d08bd
Ok.
0 rows in set. Elapsed: 0.000 sec.
milovidov-desktop :) SELECT s
FROM nested_test t1 array join nest
inner join join_test t2 on nest.y=t2.y;
SELECT s
FROM nested_test AS t1
ARRAY JOIN nest
INNER JOIN join_test AS t2 ON nest.y = t2.y
Query id: c6c5c481-7552-40d3-9b1a-d7c1facde4f3
0 rows in set. Elapsed: 0.026 sec.
Received exception:
Code: 49. DB::Exception: Bad cast from type DB::FunctionNode to DB::ColumnNode. (LOGICAL_ERROR)
Activity
novikd commentedon Jun 2, 2022
At the same moment this query works:
mofei920 commentedon Jun 6, 2022
yes, but we just want to select the only one column.
actually, SELECT s,nest.y also works.
SELECT s,nest.y
FROM nested_test t1 array join nest
inner join join_test t2 on nest.y=t2.y;
┌─s─────┬─nest.y─┐
│ Hello │ 20 │
│ World │ 40 │
└───────┴────────┘
alexey-milovidov commentedon Mar 1, 2023
Does not work with analyzer (yet):
Close: #37729