-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add support for UNION #25
Comments
I think the best approach is to create a new sublist named Option 3:
This same structure could later support CTEs and subqueries (by naming the items in |
That may be tough to parse with complicated nesting structures. CTEs are particularly difficult because they may be WITH some_cte
AS (SELECT ...)
SELECT *
FROM df1
WHERE x IN (SELECT y from some_cte)
UNION ALL
SELECT *
FROM df2
WHERE x IN (SELECT y from some_cte) If we keep the overall structure similar to the original query, it may be easier to parse. I'm not familiar with the changes that would need to be made in tidyquery, though. |
Yep, this will require some deeper thinking about the design before we make any decisions. I have some other urgent work to do in the next few weeks, so I can't commit much time to it now, but I'm happy to keep discussing ideas here. I think the |
UNION [ALL]
is probably the most popular set operation in SQL. It may be the easiest to implement as well.This might affect the structure of
parse_query
's output. That will probably have effects on tidyquery.Initial thoughts on options:
parse_query("select x from df1 union select x from df2")
Option 1:
Option 2:
The text was updated successfully, but these errors were encountered: