Skip to content

StorageJoin and with equals column names #20309

Closed

Description

@vdimir

If name of key column equals in both tables in Storage Join JOIN ON trows an error:

:) CREATE TABLE t1 (x String) ENGINE = TinyLog;

:) CREATE TABLE t2 (x String) ENGINE = Join(ALL, INNER, x);

:) select * from t1 join t2 USING(x);

Ok.

0 rows in set. Elapsed: 0.036 sec.

:) select * from t1 join t2 ON (t1.x == t2.x);

0 rows in set. Elapsed: 0.026 sec.

Received exception from server (version 21.3.1):
Code: 8. DB::Exception: Received from localhost:9000. DB::Exception: Cannot find column `t2.x` in source stream.

If secondary column name match we tables cannot be joined with USING too:

:) CREATE TABLE t1 (x String, y String) ENGINE = TinyLog;

:) CREATE TABLE t2 (x String, y String) ENGINE = Join(ALL, INNER, x);

:) select * from t1 join t2 USING(x);


0 rows in set. Elapsed: 0.027 sec.

Received exception from server (version 21.3.1):
Code: 8. DB::Exception: Received from localhost:9000. DB::Exception: Cannot find column `t2.y` in source stream.

Activity

  1. added
    bug
    on Feb 11, 2021
  2. self-assigned this
    on Feb 11, 2021
  3. added
    comp-joins
    on Feb 11, 2021
  4. vdimir commented on Aug 12, 2021

    @vdimir
    MemberAuthor

    Dup of #17956

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcomp-joinsduplicate

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions