queryparser
queryparser copied to clipboard
Add support for UNION
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:
- Keep everything flat
- Add another level to the structure
parse_query("select x from df1 union select x from df2")
Option 1:
$`select` $`select`[[1]] x
$from $from[[1]] df1
$set_op [1] union
$`select` $`select`[[1]] x
$from $from[[1]] df2
Option 2:
[[1]] [[1]]$`select` [[1]]$`select`[[1]] x
[[1]]$from [[1]]$from[[1]] df1
$set_op [1] union
[[3]] [[3]]$`select` [[3]]$`select`[[1]] x
[[3]]$from [[3]]$from[[1]] df2