Does anybody knows who to read data from hive into R and then back to Hive?
I can do it easily with Python like this:
for line in sys.stdin:
Some code ...
sys.stdout.write(Output + '\n')
Is there a similar way in R?
Thanks Tomer
Does anybody knows who to read data from hive into R and then back to Hive?
I can do it easily with Python like this:
for line in sys.stdin:
Some code ...
sys.stdout.write(Output + '\n')
Is there a similar way in R?
Thanks Tomer
if you set up Rstudio on you hive server you can easily access it via R script. You would need the Rhive package. http://cran.r-project.org/web/packages/RHive/
All you need to do after that is set your paths for hadoop and hive home in your R profile and use
library(Rhive)
rhive.init()
rhcon<-rhive.connect(address,port=)
hope that helps!
Ofir, I guess you can write your code in the some way in R. Precisely:
conn <- file("stdin", open="r")
while (length(next.line <- readLines(conn, n=1, warn=FALSE)) > 0) {
# processing
cat(output)
}