3

I want to parse a SQL statements (ANSI SQL or HiveQL) into equivalent AST. When I try to parse statements with “lateral view explode” keywords in it, which is a valid HiveQL syntax, Babel fails with ParseException. Adding these as keywords to the default list of keywords for Babel also does not help. Can someone point me to an example where something similar has been done.

devj
  • 1,123
  • 2
  • 11
  • 24

1 Answers1

0

Calcite does support the lateral keyword, but it does not support the "view explode" keywords.: https://github.com/apache/calcite/blob/master/core/src/main/codegen/templates/Parser.jj#L2083

You could extend the parser, and might be able to use the free-marker support to skip the unsupported keywords ( I haven't tried it myself ): https://calcite.apache.org/docs/adapter.html#extending-the-parser

However, if you need to access it through the corresponding SqlNode implementation, then it will require contribution given you would need to modify the core module.

more about parser.jj: https://stackoverflow.com/a/44467850/1332098

Shachar
  • 487
  • 5
  • 15