-
Notifications
You must be signed in to change notification settings - Fork 8.3k
"OR" operator in "ON" section for join #17612
Copy link
Copy link
Closed
Labels
comp-joinsJOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...JOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...feature
Description
Current behaviour
SELECT *
FROM
(
SELECT *
FROM test_data
) AS t1
ANY INNER JOIN
(
SELECT *
FROM test_data_2
) AS t2 ON (t1.id = t2.id) OR (t1.val = t2.val)
LIMIT 10
Received exception from server (version 20.5.2):
Code: 403. DB::Exception: Received from localhost:9000. DB::Exception: Invalid expression for JOIN ON. Expected equals expression, got (id = t2.id) OR (val = t2.val). Supported syntax: JOIN ON Expr([table.]column, ...) = Expr([table.]column, ...) [AND Expr([table.]column, ...) = Expr([table.]column, ...) ...].
Desired behaviour
Act according to SQL standard, support boolean logic, support all kinds of joins.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
comp-joinsJOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...JOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...feature