Support Questions
Find answers, ask questions, and share your expertise

How to get the exact query generated by the ODBC driver

How to get the exact query generated by the ODBC driver

Hi ,

We are connecting Hadoop cloudera CDH distribution through ODBC driver. Queries are generated from SSRS. Few queries are working fine with parameters augmented through ? placeholder. Few other queries with parameters augmented through ? are not executing.

Error [HY000][Cloudera][ImpalaODBC] (100) error while executing a query in Impala[HY000] 

: AnalysisException : syntax error in line 1 where Date >= ? and Date <= ? 
^Encountered : Unexpected characterExpected : Case... Exception : syntax error.

If i remove where Date >= ? and Date <= ? or supply the hard coded value then query is working perfect.

Few other queries with same filter are working perfect.

1. What should be recommended investigation points?

2. Where could i get the exact impala transformed query to investigate whether query is generated correct or not ?

2 REPLIES 2

Re: How to get the exact query generated by the ODBC driver

Re: How to get the exact query generated by the ODBC driver

New Contributor

Hi,

Here is the answer,

I thing we have a couple of options:

  • /var/log/impalad/audit stores audit logs (at least in CDH). Those logs contain sql_statement field that stores executed sql queries
  • Impala has a web server running on a 25000 Port. You could connect with your browser and see queries executed (/queries tab).
  • If you are using Cloudera Manager, you will see all the impala queries in "impala/queries

Hope this will help you.

Thanks

Elena Lauren