> library(Rserve)
> library(RHive)
> rhive.init()
[1] FALSE
> rhive.connect()
Warning:
+-------------------------------------------------------------------------------+
+ / Can't find the environment variable 'HIVE_HOME' or 'HADOOP_HOME'. +
+ / Retry rhive.connect() after calling rhive.init() with proper arguments. +
+-------------------------------------------------------------------------------+
> rhive.init(hiveHome='/opt/bfd/hive',hadoopHome='/opt/bfd/hadoop')
> rhive.connect()
2016-04-29 10:17:43,667 INFO [main] Configuration.deprecation (Configuration.java:warnOnceIfDeprecated(1049)) - fs.default.name is deprecated. Instead, use fs.defaultFS
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/bfd/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/bfd/hive/lib/hive-jdbc-0.14.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
2016-04-29 10:17:43,971 WARN [main] util.NativeCodeLoader (NativeCodeLoader.java:<clinit>(62)) - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Warning:
+----------------------------------------------------------+
+ / hiveServer2 argument has not been provided correctly. +
+ / RHive will use a default value: hiveServer2=TRUE. +
+----------------------------------------------------------+
2016-04-29 10:17:44,285 INFO [Thread-3] jdbc.Utils (Utils.java:parseURL(285)) - Supplied authorities: 127.0.0.1:10000
2016-04-29 10:17:44,286 INFO [Thread-3] jdbc.Utils (Utils.java:parseURL(372)) - Resolved authority: 127.0.0.1:10000
2016-04-29 10:17:44,344 INFO [Thread-3] jdbc.HiveConnection (HiveConnection.java:openTransport(189)) - Will try to open client transport with JDBC Uri: jdbc:hive2://127.0.0.1:10000/default
Error: org.apache.hive.service.cli.HiveSQLException: Error running query: java.lang.NullPointerException
截图如下: