【发布时间】:2015-11-22 18:52:26
【问题描述】:
我已经安装了 Spark - 1.4.1(有 R 3.1.3 版本)。目前正在测试 SparkR 以运行统计模型。我可以运行一些示例代码,例如,
Sys.setenv(SAPRK_HOME = "C:\\hdp\\spark-1.4.1-bin-hadoop2.6")
.libPaths(c(file.path(Sys.getenv("SPARK_HOME"), "R", "lib"), .libPaths()))
#load the Sparkr library
library(SparkR)
# Create a spark context and a SQL context
sc <- sparkR.init(master = "local")
sqlContext <- sparkRSQL.init(sc)
#create a sparkR DataFrame
DF <- createDataFrame(sqlContext, faithful)
sparkR.stop()
接下来,我将rJava 包安装到SparkR。但它没有安装。给出以下错误。
> install.packages("rJava")
Installing package into 'C:/hdp/spark-1.4.1-bin-hadoop2.6/R/lib'
(as 'lib' is unspecified)
trying URL 'http://ftp.iitm.ac.in/cran/bin/windows/contrib/3.1/rJava_0.9-7.zip'
Content type 'text/html; charset="utf-8"' length 898 bytes
opened URL
downloaded 898 bytes
Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
cannot open the connection
In addition: Warning messages:
1: In unzip(zipname, exdir = dest) : error 1 in extracting from zip file
2: In read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
cannot open compressed file 'rJava/DESCRIPTION', probable reason 'No such file or directory'
另外,当我在 shell 上运行 SparkR 命令时,它会作为 32 位应用程序启动。我突出显示了版本信息,如下所示。
所以,请帮我解决这个问题。
【问题讨论】:
-
我无法重现您的 32 位应用程序。您是否尝试过使用 vanilla R 会话并加载 SparkR?
-
我没有使用 vanilla R 会话。我会尝试香草 R 会话。
标签: r apache-spark sparkr rhadoop