Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

[Cloudera][JDBC](10140) Error converting value to long

avatar
Frequent Visitor

Hello, I’m getting the above error when running this query.

select count(*) from table where created_on >= date_sub(current_date(),100));

I tried casting the count to int, then I get the same error with “int” in place of “long”.

If I remove the where clause, it works just fine.

If I execute the same query in hue, I get the results back without error.

Any ideas on why this is happening and any workarounds?

Thank you.

 

 

3 REPLIES 3

avatar
Community Manager

Welcome to the community @LDAP . While you are waiting for someone more knowledgable than me to reply, can you perhaps add some more context here? For instance what versions of Spark and JDBC are you using?


Keep the questions coming

avatar
Frequent Visitor
Correction - I’m using cloudera hive jdbc driver 2.6.21.1025

avatar
Contributor

Hi @LDAP , since you mentioned that the same query is working fine on Hue, could you try to set UseNativeQuery=1 on your driver configuration and retry the query.

Reference: https://docs.cloudera.com/documentation/other/connectors/hive-jdbc/2-6-26/Cloudera-JDBC-Connector-fo... (page 109)