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

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

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

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.

; ;