Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hive does not throw any exception for non exist database

Highlighted

Hive does not throw any exception for non exist database

Rising Star

I am trying to connect hive non exist database using jdbc url . It does not throw any error and it is connecting with default database which should not be. This issue is occurring for hive-jdbc-1.2.1. if we use version hive-jdbc-0.12.0-cdh5.1.2 then we are getting proper exception showing Database does not exist. I am using HDP 2.4.2 and Hive 1.2.1.2.4 . I do not want to use cloudera jar. My code snapshot is given below where "acb" is unknown database.

Class.forName("org.apache.hive.jdbc.HiveDriver");
conn = DriverManager.getConnection("jdbc:hive2://*****.***.***:10000/acb");

Is it bug for hive jdbc driver ? Please help to fix this issue asap.

2 REPLIES 2
Highlighted

Re: Hive does not throw any exception for non exist database

Super Guru
@Arkaprova Saha

Can you try connecting to another database which actually exists. Does that work? There was a known issue in Hive JDBC which was fixed in hive 0.13 but it was ignoring any database regardless. Check the following if this applies to you.

https://issues.apache.org/jira/browse/HIVE-4256

Highlighted

Re: Hive does not throw any exception for non exist database

Rising Star

@mqureshi

Thanks for your reply . This is working for existing database. But we are facing this issue for non existing database . Looks like issue is not resolved yet.

Don't have an account?
Coming from Hortonworks? Activate your account here