Hadoop streaming works fine with me when i try examples like wordcount but when i try to call R package
of any type in the map function i get streaming error code 1. here is the code
Sys.setenv("HADOOP_CMD"="/usr/local/CELLAR/hadoop/2.7.1/bin/hadoop")
Sys.setenv("HADOOP_STREAMING"="/usr/local/Cellar/hadoop/2.7.1/libexec/share/hadoop/tools/lib/hadoop-streaming-2.7.1.jar")
Sys.setenv("HADOOP_HOME="="/usr/local/Cellar/hadoop/2.7.1")
# load librarys
library(rmr2)
library(rhdfs)
# load sample data
data(iris)
# init hdfs
hdfs.init()
# push data to hdfs
iris.dfs <- to.dfs(iris)
# define map function
iris.map <- function(k, v) {
library(kernlab)
lssvm(v$Species ~ ., data=v)
String(x)
}
# rum mar job
iris.svm <- mapreduce(input=iris.dfs, map=iris.map)
Thank you