Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An incorrect query result, where the distributed query plan seems wrong #7698

Open
duerwuyi opened this issue Oct 5, 2024 · 1 comment
Open

Comments

@duerwuyi
Copy link

duerwuyi commented Oct 5, 2024

DROP TABLE IF EXISTS t1;
create table t1 ( 
vkey int4 ,
c10 int4 
);
DROP TABLE IF EXISTS t3;
create table t3 ( 
vkey int4 
);


insert into t3 (vkey) values (1);
insert into t1 (vkey,c10) values (4, -70);

I made t1 as a distributed table:
SELECT create_distributed_table('t1', 'vkey');

query:

select  t3.vkey
from  (t1  right outer join t3 
    on (t1.c10 = t3.vkey ))
where exists (select  *   from   t3);

The result should be t3.vkey = 1 ,but actually returns nothing. The citus version is 12.5.

@duerwuyi
Copy link
Author

duerwuyi commented Oct 5, 2024

the distributed query plan of this query:
Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=100000 width=4)
-> Distributed Subplan 1_1
-> Seq Scan on t3 (cost=0.00..35.50 rows=2550 width=4)
-> Distributed Subplan 1_2
-> Seq Scan on t3 (cost=0.00..35.50 rows=2550 width=4)
Task Count: 0
Tasks Shown: All

task count should not be 0.

@duerwuyi duerwuyi changed the title a Distributed table right outer join a non-empty undistributed table, and return nothing. An incorrect query result which distributed query plan seems wrong Oct 5, 2024
@duerwuyi duerwuyi changed the title An incorrect query result which distributed query plan seems wrong An incorrect query result, where the distributed query plan seems wrong Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant