I'm pretty new in Hadoop & RHadoop. So, was trying to sort data in Mapreduce structure using RHadoop. But I can't sort the data. The code is given below. Can anybody please help me to find out where I'm making the mistake. The reason for trying this problem is want to know how to define key variable & value variable.
small.ints=runif(100,10.0,20.0)
data<-sample(1:100,100,replace=F)
data1<-data.frame(data,small.ints)
hdfs.input = to.dfs(data1)
# Mapper
mapper <- function(k,v) {
key <- data
value <-small.ints
keyval(key,value)
}
#Reducer
reducer <- function(k,v) {
key <- k
value <- v
keyval(key,arrange(v))
}
#mapreduce program
out<-mapreduce(
input = hdfs.input,
map = mapper,reduce=reducer)
Thanks a lot!