Closed bachung-stripe closed 2 years ago
@bachung-stripe Thanks for reporting this, I'm able to reproduce this.
Have you seen this in any other dialect parser?
I can't get the queries to parse in Vertica, but in Hive, I get the same error in getColumns.
In Hive:
getColumns $ fst $ parseAndResolve "SELECT fooAlias.a from (select a, b from foo union select a, b from foo) as fooAlias"
I'm not super familiar with the differences between each dialect though.
Got it, I'll see if I can get a bugfix in by next week
I haven't had the time to solve this, for now I'll put my debugging branch up (https://github.com/uber/queryparser/tree/heli/fix_getColumns). I have a test target that the bugfix needs to pass, as well as some QOL improvements in the testing output.
Hopefully I can make progress on this, until then I'll update if I can crack the bug. Anyone else is also welcome to fix and open a pull request.
I'm getting some errors when trying to
getColumns
for certain Presto queries that use union.For example:
getColumns $ fst $ parseAndResolve "select aAlias from (select a as aAlias, b from foo union select a as aAlias, b from foo)"
orgetColumns $ fst $ parseAndResolve "select a from (select a, b from foo union select a, b from foo)"
will fail withBut not
getColumns $ fst $ parseAndResolve "select c from (select a, b from foo union select a, b from foo)"
orgetColumns $ fst $ parseAndResolve "select a, b from foo union select a, b from foo"
(where parseAndResolve is using the Presto query parser)
This also happens if you use
intersect
instead ofunion