Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive, mail # user - Connecting to Hive from R through JDBC


+
Saurabh S 2013-05-07, 18:55
Copy link to this message
-
Re: Connecting to Hive from R through JDBC
Sanjay Subramanian 2013-05-08, 00:27
Hi Saurabh

The usual suspect looks like hive-server service is not running on server where hive is installed….The hive-server service needs to be installed and started….It listens on port 10000 by default.

Also on a side note is I hope your Hive connecting to MySQL or some non-derby RDBMS :-)

Thanks
sanjay

From: Saurabh S <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Reply-To: "[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>" <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Date: Tuesday, May 7, 2013 11:55 AM
To: "[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>" <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Subject: Connecting to Hive from R through JDBC

Hi,

I'm trying to use package RJDBC to connect to hive through R. My client machine, on which R is installed, is Windows 7. I installed the package, then copied the file hive-jdbc-0.9.0-cdh4.1.2.jar to my local R work folder. Then used the following commands:

I was able to read the driver through following command:
drv <- JDBC('org.apache.hadoop.hive.jdbc.HiveDriver', 'C:/Users/Saurabh/Documents/RWork/hive-jdbc-0.9.0-cdh4.1.2.jar')

But when I try to make the connection using the following command:
conn <- dbConnect(drv, 'jdbc:hive://<hostname>:<port>/default')

I get the following error:
java.lang.NoClassDefFoundError: org/apache/hadoop/hive/metastore/api/MetaException

Any idea why this is happening? Some say that it's best to have R and Hive on the same server so that you can just pass localhost in the dbConnect command. But that's not an option for me because even if R is installed on the Hadoop server, RJDBC isn't available and I'm just a local user.

Thanks,
Saurabh

CONFIDENTIALITY NOTICE
=====================This email message and any attachments are for the exclusive use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message along with any attachments, from your computer system. If you are the intended recipient, please be advised that the content of this message is subject to access, review and disclosure by the sender's Email System Administrator.
+
Saurabh S 2013-05-08, 17:28
+
Sanjay Subramanian 2013-05-08, 17:41