How to access Impala Parser analysis

Does Impala reuse SQL parser?

I am trying to write native Java code to validate a request in my application. I'm looking for an api that can use a sql query and let me know if it's grammatically correct for impala.

How can I access the parser from custom Java code to check the compatibility of requests?

+3


source to share


1 answer


No, Impala does not reuse the Hive parser. In addition, Impala does not provide a Java API to validate the grammar of a request. The easiest way to do this is probably to send an explanation of the request via JDBC and check the result.



If you don't have an Impala cluster running, in theory you should be able to instantiate a scanner and parser, as Impala does in parser block test , but I can imagine it would be difficult to get this working since the Impala build / test environment is quite complex. Please note that this is not a supported API.

+3


source







All Articles