Skip to content

v23.3 right join and full out join result set is incorrect #56005

Open

Description

@h1k

Describe the unexpected behaviour
When I used right join, I noticed that it didn't get the same result as left join

How to reproduce

  • Which ClickHouse server version to use
    v23.3.13.6-lts

  • CREATE TABLE statements for all tables involved
    create table t (ID String) Engine= Memory() ;
    insert into t values('a'),('b'),('c');
    create table s (IDS String) Engine= Memory() ;
    insert into s values('a'),('b'),('d');

  • Queries to run that lead to unexpected result

SELECT *   FROM   remote('127.0.0.{1,2}', default, t) as t right JOIN remote('127.0.0.{1,2}', default, s) as s ON t.ID=s.IDS;

SELECT * FROM   remote('127.0.0.{1,2}', default, s) as s left JOIN   remote('127.0.0.{1,2}', default, t) as t on t.ID=s.IDS

Expected behavior
The results of the two SQL statements should be the same. In fact, the number of right join data increases.

In addition, I found the same problem with full out join
https://fiddle.clickhouse.com/5386da00-0b55-4cc0-b8ce-15bad1a0334b

Activity

  1. added
    unexpected behaviour
    on Oct 25, 2023
  2. reopened this on Nov 9, 2023
  3. h1k commented on Nov 9, 2023

    @h1k
    Author

    right join have a lot more data than equivalent left join,anyone could help ?

  4. added
    comp-joins
    on Sep 4, 2026
  5. added
    external
    on Sep 11, 2026
  6. added
    comp-distributed
    and removed
    comp-joins
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-distributedexternalunexpected behaviour

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions