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
✨ support UNION statements #21
Comments
[
{
"Query":{
"with":"None",
"body":{
"SetOperation":{
"op":"Union",
"all":false,
"left":{
"Select":{
"distinct":false,
"top":"None",
"projection":[
{
"UnnamedExpr":{
"Function":{
"name":[
{
"value":"TIME",
"quote_style":"None"
}
],
"args":[
],
"over":"None",
"distinct":false
}
}
}
],
"from":[
],
"lateral_views":[
],
"selection":"None",
"group_by":[
],
"cluster_by":[
],
"distribute_by":[
],
"sort_by":[
],
"having":"None"
}
},
"right":{
"Select":{
"distinct":false,
"top":"None",
"projection":[
{
"UnnamedExpr":{
"Function":{
"name":[
{
"value":"TIME",
"quote_style":"None"
}
],
"args":[
],
"over":"None",
"distinct":false
}
}
}
],
"from":[
],
"lateral_views":[
],
"selection":"None",
"group_by":[
],
"cluster_by":[
],
"distribute_by":[
],
"sort_by":[
],
"having":"None"
}
}
}
},
"order_by":[
],
"limit":"None",
"offset":"None",
"fetch":"None"
}
}
] |
Likely to be part of #808 |
have three outstanding issues: SELECT * , even on the same table, doesn't resolve because of wildcard handling and pushdowns SELECT * FROM $planets AS P1 UNION SELECT * FROM $planets AS P2; ORDER BY not being in SELECT results in duplicate entries because the projection to get rid of the ORDERED columns is after the DISTINCT (SELECT name FROM $planets AS P1 ORDER BY mass DESC) UNION (SELECT name FROM $planets ORDER BY diameter ASC) Missing column, not diagnosed yet. SELECT AVG(mass) FROM $planets AS p1 UNION SELECT SUM(diameter) FROM $planets |
SELECT * the only issue outstanding. The first (LEFT) table is getting all of the columns, the RIGHT is handling like it's a COUNT(*) query (i.e. no columns explicitly referenced) |
UNION wil likely require changes to the parser as it may need to dynamically get the statement being worked on from a list, rather than hard-coded to 0
The text was updated successfully, but these errors were encountered: