Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Impala ODBC driver returned an error (SQLExecDirectW)

avatar
New Contributor

Hi,

 

I'm having a problem with ClouderaImpalaODBC64.dll version 2.16.14.1016.

 

SQLExecDirectW function returns an error when executing the following query:

 

With variable1 as

(

SELECT orders.order_id, orders.order_date

FROM quest_stage.orders orders

WHERE orders.order_date = (CAST(? AS TIMESTAMP))

)

Select * from variable1

 

Error details:

[Cloudera][ImpalaODBC] (110) Error while executing a query in Impala: [HY000]: ParseException: Syntax error in line 5

 

It seems to be the problem when you combine WITH and CAST keywords.

 

Both of the following queries below work:

 

SELECT orders.order_id, orders.order_date

FROM quest_stage.orders orders

WHERE orders.order_date = (CAST(? AS TIMESTAMP))

----------------------------------------------------------------------------------------------

With variable1 as
(
SELECT orders.order_id, orders.order_date
FROM quest_stage.orders orders
)
Select * from variable1

 

Could you help me understand what seems to be the problem here and is there any solution to this problem?

4 REPLIES 4

avatar
Expert Contributor

Hi @Katja 

 

CAST is supported in impala and hive, you said the query works where have you tested it. Can you try running on beeline and see if it works.

avatar
New Contributor

Hi @HanzalaShaikh,

 

I'm not having problem with only CAST, as you can see from the second query I wrote, second and third query from my original post works fine. Only combination of CAST and WITH is giving me this error. I'm new with Impala and I haven't use Beeline before (I'll google it though, tnx).

avatar
Super Guru

@Katja ,

 

I'm not totally sure but it may be possible that bind variables are accepted inside WITH clauses. Would you be able to try the alternative below?

With variable1 as
(
SELECT orders.order_id, orders.order_date
FROM quest_stage.orders orders
)
Select *
from variable1
WHERE order_date = (CAST(? AS TIMESTAMP))

 

Cheers,

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
New Contributor

Hi @araujo,

 

I tried the query you wrote and unfortunately I'm getting the same mistake, just on the last line.