rhdfs - 将数据集写入hdfs时出错的RJavaTools错误

时间:2014-02-21 15:09:23

标签: r hadoop hdfs rjava

我在hadoop的hortonworks沙盒版本上运行rStudio Server。我加载了rhdfs包,但是当我尝试使用hdfs.put()命令将数据集写入hdfs时,我收到以下错误:

hdfs.put(mtcars,"/user/root")
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
  java.io.IOException: File c(21, 21, 22.8, 21.4, 18.7, 18.1, 14.3, 24.4, 22.8, 19.2, 17.8, 16.4, 17.3, 15.2, 10.4, 10.4, 14.7, 32.4, 30.4, 33.9, 21.5, 15.5, 15.2, 13.3, 19.2, 27.3, 26, 30.4, 15.8, 19.7, 15, 21.4) does not exist

之前有人遇到过此问题吗?我假设它与在64位操作系统上使用32位版本的Java有关。任何建议都非常感谢

1 个答案:

答案 0 :(得分:1)

虽然回答为时已晚,但人们可能会觉得这很有用。

命令' hdfs.put' rhdfs包可用于将文件从本地文件系统传输到HDFS。在这种情况下,mtcars内置在R数据框架中,在使用' hdfs.put'移动到hdfs之前,必须先将其保存到本地磁盘。命令。

R代码:

# Save built in data set to local disk
save(mtcars, file = "/home/mtcars.RData")

# Move data from local to hdfs
hdfs.put("/home/mtcars.RData", "/in")
相关问题