Origin
Connecting to hive seems to be unable to find the correct configuration and download on the network.
Therefore only according to the official. Analysis
First install the package directly, compile the rhive, the hint can not be found. But prompted to find a hiver package.
Then install the hiver package directly, and you will be prompted to make JPEG and PNG errors.
Then I estimate that either there is a problem when configuring configure, or there is no package that supports the corresponding format. Real Exercise
Configure the problem, I reconfigure, and the configuration is basically true, not according to the simplest configuration of false.
After the Configure problem is resolved, then the installation configuration is JPEG and PNG.
Installing make cannot, then it is missing the corresponding environment for make.
The environment here gives two. However, it is best to configure the comparison recommendation before installing R.
Yum install-y libpng-devel
yum install-y libjpeg-devel
Once these two configurations are complete, you can install them directly in R.
Install.packages ("JPEG")
install.packages ("png")
install.packages ("Rserve")
After configuring these three, you are ready to start the installation rhive.
However, the direct install, or the prompt cannot.
Then it can only be installed locally according to the latest tar package that is officially given. Key Operations
Download the corresponding package on the official website: https://cran.r-project.org/src/contrib/Archive/RHive/
Find the latest version and download it locally.
Then upload to the local Linux installation.
R CMD INSTALL rhive_2.0-0.2.tar.gz
#完毕后在R中就可以引用了
> Library (rhive)
Loading required Package:rjava
connecting to Hive is another operation
> Library (rhive); Loading Required Package:rjava > rhive.connect (host = ' 114.215.182.147 ') 2017-01-12 13:47:22,243 INFO CONFIGURATION.D Eprecation (Configuration.java:warnOnceIfDeprecated (1173))-Fs.default.name is deprecated.
Instead, use Fs.defaultfs slf4j:class path contains multiple slf4j bindings. Slf4j:found Binding in [jar:file:/home/hadoop/hadoop-2.7.3/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/ Slf4j/impl/staticloggerbinder.class] Slf4j:found binding in [jar:file:/home/hadoop/hadoop-2.7.3/share/hadoop/
Httpfs/tomcat/webapps/webhdfs/web-inf/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/staticloggerbinder.class] Slf4j:found Binding in [jar:file:/home/hadoop/hadoop-2.7.3/share/hadoop/kms/tomcat/webapps/kms/web-inf/lib/ Slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/staticloggerbinder.class] Slf4j:found binding in [Jar:file:/home/hive/lib /log4j-slf4j-impl-2.4.1.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] 2017-01-12 13:47:23,714 WARN util. Nativecodeloader (nativecodeloader.java:<clinit>)-Unable to load Native-hadoop library for your platform ... u
Sing Builtin-java classes where applicable Warning: +----------------------------------------------------------+ +/HiveServer2 argument have not been provided correctly. + +/rhive would use a default value:hiveserver2=true. + +----------------------------------------------------------+ 2017-01-12 13:47:25,390 INFO jdbc. Utils (Utils.java:parseURL (318))-supplied authorities:114.215.182.147:10000 2017-01-12 13:47:25,392 INFO jdbc. Utils (Utils.java:parseURL (437))-Resolved authority:114.215.182.147:10000 [1] FALSE >
The above information indicates that rhive is ready to work, and we will then be able to read the data in hive in R. R Read for hive data
Library (rhive)
rhive.connect (host = ' 114.215.xxx.xxx ', port=10000); #rhive连接hive2
> x <-rhive.query (' Select id from studentinfo ')
> Print (x)
ID
1 NA
2 na
3 na
4 na
5 1
6 2
7 3
8 9 1 2 3
12 100
You can see that the data has been read and can be drawn graphically in the R language. PostScript
Each time the configuration and try to go a few pits.
Do not blame the incomplete information, or to try their own, based on experience to find the source of the error, and then the corresponding method to solve.