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

bug in parenthesis #37

Closed
aosokin opened this issue Oct 11, 2021 · 7 comments
Closed

bug in parenthesis #37

aosokin opened this issue Oct 11, 2021 · 7 comments

Comments

@aosokin
Copy link

aosokin commented Oct 11, 2021

following #35 and #36
SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)
to
SELECT name FROM stadium WHERE stadium_id NOT IN ((SELECT stadium_id FROM concert))

SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States')
to
SELECT rid FROM routes WHERE dst_apid IN ((SELECT apid FROM airports WHERE country = 'United States'))

SELECT COUNT(*) FROM (SELECT cName FROM tryout INTERSECT SELECT cName FROM tryout)
to
SELECT COUNT(*) FROM SELECT cName FROM tryout INTERSECT SELECT cName FROM tryout

@klahnakoski
Copy link
Owner

Do you have a source for these? Maybe I should work on a whole suite of examples at once.

@aosokin
Copy link
Author

aosokin commented Oct 11, 2021

Do you have a source for these? Maybe I should work on a whole suite of examples at once.

I'm trying to use your parser for several datasets for the task of translating English text to SQL queries:

I've already tried a number of parsers on these queries, and yours is actually very close to working on all these queries :-)
Thanks a lot for your great work!

I'm not sure whether it is feasible to just try the parser on all of these queries, because it might be hard to check whether the output of the formatted is equivalent to the input queries. I was going over these queries, running all the queries and their parsed-formatted versions on actual databases from the datasets, comparing the results, and building a more-or-less minimal example of where the error comes from.
Maybe my strategy of submitting individual issues was not convenient for you, sorry for that!
What would be a better way to proceed? Should I get together the list of all the problematic queries first?

@klahnakoski
Copy link
Owner

Maybe my strategy of submitting individual issues was not convenient for you, sorry for that!

No problem. Individual issues is best because it gives me discrete chunks to work on. I was only concerned about whatever work you were doing.

The biggest task in a program like mo-sql-parsing is writing the test suite. If you have managed to find a source of SQL, then I use it to make a more-comprehensive suite.

@klahnakoski
Copy link
Owner

Looking at the examples you posted, I wonder if this project should be using that simpler format

@aosokin
Copy link
Author

aosokin commented Oct 11, 2021

Thanks! Then I'll continue creating issues and adding examples similar to already created issues.

@aosokin
Copy link
Author

aosokin commented Oct 11, 2021

Looking at the examples you posted, I wonder if this project should be using that simpler format

Do you mean the format used in Spider? It suits the examples I posted because those were from Spider but it does not go well with other sources (ATIS and Geography). I like your format a lot more because it is more flexible.

@klahnakoski
Copy link
Owner

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