我已经使用5个节点的hadoop集群(包括带有SparkR的Apache Spark )创建了IBM服务。我尝试使用SparkR连接cloudant数据库,获取一些数据并进行一些处理。
在BigInsights hadoop群集中使用spark-submit提交SparkR作业(R脚本)失败。我已经创建了SparkR脚本并运行了以下代码,
-bash-4.1$ spark-submit --master local[2] test_sparkr.R
16/08/07 17:43:40 WARN SparkConf: The configuration key 'spark.yarn.applicationMaster.waitTries' has been deprecated as of Spark 1.3 and and may be removed in the future. Please use the new key 'spark.yarn.am.waitTime' instead.
Error: could not find function "sparkR.init"
Execution halted
-bash-4.1$test_sparkr.R文件的内容为:
# Creating SparkConext and connecting to Cloudant DB
sc <- sparkR.init(sparkEnv = list("cloudant.host"="<<cloudant-host-name>>","<<><<cloudant-user-name>>>","cloudant.password"="<<cloudant-password>>", "jsonstore.rdd.schemaSampleSize"="-1"))
# Database to be connected to extract the data
database <- "testdata"
# Creating Spark SQL Context
sqlContext <- sparkRSQL.init(sc)
# Creating DataFrame for the "testdata" Cloudant DB
testDataDF <- read.df(sqlContext, database, header='true', source = "com.cloudant.spark",inferSchema='true')如何在IBM BigInsights中安装spark-cloudant连接器并解决该问题。做有需要的事吧。如果能帮上忙,我们将不胜感激。
发布于 2016-08-08 19:10:51
我相信spark-cloudant连接器还不适用于R。
希望我能在答案是正确的时候更新它!
https://stackoverflow.com/questions/38817065
复制相似问题