Can't get Hive driver working

Note: please leave bug reports and feature requests on GitHub

Can't get Hive driver working

Postby johnyaya » Thu May 12, 2016 3:30 pm

We're on Hive 0.14.x. I thought the safest thing to do would be to create a new driver. So I did that. I set my class name to be:
Code: Select all
org.apache.hive.jdbc.HiveDriver


URL Template:
Code: Select all
jdbc:hive2://{host}[:{port}]/{database}

I added an artifact to pull the drivers from maven.
Code: Select all
Group ID:
org.apache.hive

Artifact:
hive-jdbc

Version:
0.14.0


So far so good. Next I go to create a connection using the driver. Since this is the first time I've used it, it tells me the driver files are missing, and prompts me to download. That seems to go fine as well. So I go ahead and enter all the relevant info for the connection. When I click the test button, I get the following error:
Code: Select all
DBCConnectException: Unexpected driver error occurred while connecting to database
  NoClassDefFoundError: org/apache/hadoop/conf/Configuration
    java.lang.ClassNotFoundException: ClassNotFoundException: org.apache.hadoop.conf.Configuration


What am I doing wrong?
johnyaya
 
Posts: 2
Joined: Thu May 12, 2016 3:19 pm

Re: Can't get Hive driver working

Postby Serge » Thu May 12, 2016 8:24 pm

Because Hive driver has extra Maven dependencies (besides hive-jdbc).
Why not to use preconfigured Hive driver?
Another way is to download Hive driver manually and add jars in your custom driver configuration (it may be better because Maven artifact is really huge).
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb

Re: Can't get Hive driver working

Postby johnyaya » Thu May 12, 2016 9:01 pm

Using the preconfigured driver, I get an error about:
Required field 'client_protocol' is unset!

Googling leaves me with the impression that this driver is newer than our installation, and it won't play nicely.
johnyaya
 
Posts: 2
Joined: Thu May 12, 2016 3:19 pm

Re: Can't get Hive driver working

Postby Serge » Thu May 12, 2016 10:39 pm

Yes, Hive driver has strict server version dependency.
You can change driver's artifact version right in the download dialog. Just click on the version number.
Serge
 
Posts: 1526
Joined: Sat Feb 26, 2011 8:24 pm
Location: SPb


Return to Support



Who is online

Users browsing this forum: No registered users and 36 guests