Last active
November 17, 2015 05:05
-
-
Save gbraccialli/3d4ad2ad8d41ec875dd3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options( java.parameters = "-Xmx20g" ) | |
library(rJava) | |
library(RJDBC) | |
cp = c("/usr/hdp/current/hive-client/lib/hive-jdbc.jar", | |
"/usr/hdp/current/hadoop-client/hadoop-common.jar") | |
.jinit(classpath=cp) | |
drv <- JDBC("org.apache.hive.jdbc.HiveDriver", | |
"/usr/hdp/current/hive-client/lib/hive-jdbc.jar", | |
identifier.quote="`") | |
conn <- dbConnect(drv, "jdbc:hive2://servername:10000/demo", "user", "password") | |
show_databases <- dbGetQuery(conn, "show databases") | |
show_databases |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment