R语言连接HIVE

install.packages("RJDBC",dep=TRUE)

library(RJDBC)

drv <- JDBC('org.apache.hive.jdbc.HiveDriver',list.files("D:/r_hive_libs",pattern = "jar$", full.names=TRUE,recursive=TRUE))

conn<- dbConnect(drv, sprintf('jdbc:hive2://%s:%s/ygyy','10.2.65.38', '10000'))

dbGetQuery(conn,'select count(1) from yy_yy_step_cfnrb_gz')

你可能感兴趣的:(R语言连接HIVE)