ClickHouse / ClickHouse

ClickHouse® is a real-time analytics DBMS
https://clickhouse.com
Apache License 2.0
37.74k stars 6.92k forks source link

INVALID_JOIN_ON_EXPRESSION with allow_experimental_join_condition =1 and join_use_nulls =1 #68964

Open SteZe85 opened 2 months ago

SteZe85 commented 2 months ago

Using both of these settings:

join_use_nulls = 1 allow_experimental_join_condition = 1

will lead to this error with no indication that these settings are exclusive:

SQL-Fehler [403] [07000]: Code: 403. DB::Exception: JOIN INNER JOIN ... ON (foo.id = bar.id) AND (foo.a > bar.b) join expression contains column from left and right table, you may try experimental support of this feature by SET allow_experimental_join_condition = 1. (INVALID_JOIN_ON_EXPRESSION) (version 24.9.1.1350 (official build))

Example:

SELECT foo.a
FROM
    (
        SELECT 1 as id, 1 AS a
    ) AS foo
JOIN 
    (
        SELECT 1 as id,  2 as b
    ) AS bar
ON
    foo.id = bar.id and foo.a > bar.b
SETTINGS allow_experimental_join_condition  = 1   
SETTINGS join_use_nulls = 1
SteZe85 commented 1 week ago

Will this be addressed before non equi join leaves experimental phase?