I have successfully connected local R3.1.2( win7 64bit rstudio) and remote hive server using rjdbc
,
library(RJDBC)
.jinit()
dir = "E:/xxx/jars/hive/"
for(l in list.files(dir)) {
.jaddClassPath(paste( dir ,l,sep="")) }
options( java.parameters = "-Xmx8g" )
drv <- JDBC("org.apache.hadoop.hive.jdbc.HiveDriver",
"E:/xxx/jars/hive/hive-jdbc-0.11.0.jar")
conn <- dbConnect(drv, "jdbc:hive://10.127.130.162:10002/default", "", "" )
dbGetQuery(conn, "select * from test.test limit 10 ")
successfully read data from hive ,but I cannot write R data frame using
dbWriteTable
:
data(iris)
dbWriteTable(conn, iris , "test.dc_test")
Error return:
Error in .jcall(md, "Ljava/sql/ResultSet;", "getTables", .jnull("java/lang/String"), :
method getTables with signature (Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Ljava/sql/ResultSet; not found
Either my misuse or other methods needed?