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

Help, throw an exception when parsing #71

Closed
wjinshui opened this issue Jul 13, 2019 · 1 comment
Closed

Help, throw an exception when parsing #71

wjinshui opened this issue Jul 13, 2019 · 1 comment

Comments

@wjinshui
Copy link

Try to execute the following statement, but an exeception throws, please help!

schema s1(id:int, year_born:int);
schema s2(id:int);
table person(s1);
table writer(s2);
query q1 `select count(*) from person where exists (select * from writer where writer.id = person.id and person.year_born = 1935)`;
query q2 `select count(*) from (select distinct person.id from person,writer where person.id=writer.id and person.year_born=1935)`;
verify q1 q2;
@stechu
Copy link
Contributor

stechu commented Jul 15, 2019

Hi Jinshui,

I rewrite your query as below:

schema s1(id:int, year_born:int);
schema s2(id:int);
table person(s1);
table writer(s2);
query q1 
`select count(*) from person p where exists (select * from writer w where w.id = p.id and p.year_born = 1935)`;
query q2 `select count(*) from (select distinct p.id from person p, writer w where p.id=w.id and p.year_born=1935) a`;
verify q1 q2;

It returns a counterexample. Currently, we are forcing that user put an alias for each table.

@stechu stechu closed this as completed Jul 22, 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

2 participants