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?
Created 03-21-2022 03:46 AM
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.
Created 03-22-2022 02:19 AM
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).
Created 03-21-2022 03:23 PM
@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.
Created 03-22-2022 02:09 AM
Hi @araujo,
I tried the query you wrote and unfortunately I'm getting the same mistake, just on the last line.