Quantcast
Channel: Hortonworks » All Replies
Viewing all articles
Browse latest Browse all 3435

Reply To: R and Hive via RJDBC?

$
0
0

Try this for installation:
setInternet2(TRUE)

install.packages(c(“RJDBC”))

This is how you can use it (assuming the jars are in your classpath or you provide the full path to them):
drv <- JDBC(“org.apache.hive.jdbc.HiveDriver”, c(“hive-jdbc-0.14.0.2.2.4.2-0002-standalone.jar”,” hadoop-common-2.6.0.2.2.4.2-0002.jar”),identifier.quote=”`”)

conn <- dbConnect(drv, “jdbc:hive2://localhost:10001/mydb”, “hive”, “hive”)

result<-dbGetQuery(conn, “select * from table”)

print(result)


Viewing all articles
Browse latest Browse all 3435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>