2014-02-21 26 views
1

我在hortonworks沙箱版本的hadoop上運行rStudio服務器。我加載了rhdfs包,但是當我嘗試寫一個數據集來使用hdfs.put HDFS()命令我收到以下錯誤:rhdfs - RJavaTools錯誤將數據集寫入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

儘管它爲時已晚回答,認爲人們可能會覺得這有用。

rhdfs包的命令'hdfs.put'可用於將文件從本地文件系統傳輸到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")