Skip to content

Duplicates on RIGHT JOIN with Values table and parallel_replicas_local_plan=0 (Parallel replicas) #74341

@fm4v

Description

@fm4v

Reproduced only with RIGHT JOIN and parallel_replicas_local_plan=0;

DROP TABLE IF EXISTS t1;

CREATE TABLE t1 (
    key UInt32,
    a UInt32,
    attr String
) ENGINE = MergeTree ORDER BY key;

INSERT INTO t1 (key, a, attr) VALUES (1, 10, 'alpha'), (2, 15, 'beta'), (3, 20, 'gamma');

SET enable_analyzer=1;
set parallel_replicas_local_plan=0;
set enable_parallel_replicas=1;

SELECT * FROM t1 RIGHT JOIN (SELECT * FROM VALUES('key UInt64, a UInt64', (0, 10), (1, 100), (2, 1000))) t3 ON t1.key=t3.key ORDER BY ALL;

Result:

0	0		0	10
0	0		0	10
0	0		0	10
0	0		1	100
0	0		1	100
0	0		2	1000
0	0		2	1000
1	10	alpha	1	100
2	15	beta	2	1000

Expected:

0	0		0	10
1	10	alpha	1	100
2	15	beta	2	1000

Affected tests:

03006_join_on_inequal_expression_3.sql.j2

Version: 25.1.1.1921

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed user-visible misbehaviour in official releasecomp-parallel-replicasParallel reading from replicas for query speed (not data replication consistency).

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions