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

Getting the following error while running sql on hive using odbc driver


We are connecting to hive and running sql thru ODBC driver. Getting the following error

hortonworks error [Hortonworks][SQLEngine] (31340) DATEDIFF is not a valid scalar function or procedure call. we have a sql which has a select and it has a simple datediff which seems to be causing the issue

DATEDIFF('2017-02-02', '2017-02-01') as Exp_curr_dt

Have any of you experienced this issue? please let me know if you have any suggestions to fix this.

Also, the parent query has an alias which has an underscore in the front of the name and it doesn't work if I directly execute this unless I enclose it within tick symbol. But from odbc however the query goes thru except for the datediff part.

We are using the 2.1.5 odbc driver 64 bit version. The application connecting to hive and executing sql is written in .net



@Anika S

I didn't see any issue with datediff function through hdp 2.1.5 ODBC driver.



Thank you.

Expert Contributor

@Anika S 2 years later, I have the same issue. Did you manage to fix it? If so, how?

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.