Skip to content

"OR" operator in "ON" section for join #17612

@ilejn

Description

@ilejn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-joinsJOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions