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

Not found column for duplicate columns in JOIN ON section #4271

Closed
4ertus2 opened this issue Feb 5, 2019 · 2 comments
Closed

Not found column for duplicate columns in JOIN ON section #4271

4ertus2 opened this issue Feb 5, 2019 · 2 comments
Assignees

Comments

@4ertus2
Copy link
Contributor

4ertus2 commented Feb 5, 2019

Cannot resolve duplicated column from right table of JOIN.

create table t(a Nullable(Int64), b Nullable(Int64), c Nullable(String)) engine = Memory;
create table s(a Nullable(Int64), b Nullable(Int64), c Nullable(String)) engine = Memory;

insert into t values(1,1,'a'), (2,2,'b');
insert into s values(1,1,'a');

select * from t left outer join s on t.a = s.a;
1       1       a       1       1       a
2       2       b       \N      \N      \N

select * from t left outer join s on t.a = s.a and t.a = s.b;
1       1       a       1       1       a
2       2       b       \N      \N      \N

select * from t left outer join s on t.a = s.a and t.a = s.a;
Code: 10. DB::Exception: Received from localhost:9000, 127.0.0.1. DB::Exception: Not found column s.a in block. There are only columns: s.b, s.c. 

select * from t left outer join s on t.a = s.a and t.b = s.a;
Code: 10. DB::Exception: Received from localhost:9000, 127.0.0.1. DB::Exception: Not found column s.a in block. There are only columns: s.b, s.c.
@4ertus2 4ertus2 self-assigned this Feb 5, 2019
@4ertus2
Copy link
Contributor Author

4ertus2 commented Feb 5, 2019

Possibly related errors #4222 #971

4ertus2 added a commit to 4ertus2/ClickHouse that referenced this issue Feb 5, 2019
@4ertus2
Copy link
Contributor Author

4ertus2 commented Feb 5, 2019

fixed in master

@4ertus2 4ertus2 closed this as completed Feb 5, 2019
ztlpn pushed a commit that referenced this issue Feb 13, 2019
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