Back ground
I managed to read a file with command:
dataSet = fread("/usr/bin/hadoop fs -text /pathToMyfile/test.csv")
My problem:
And I would like to write it (after some transformation) into test2:
fwrite(dataSet, file = "| /usr/bin/hadoop dfs -copyFromLocal -f - /pathToMyfile/test2.csv")
My error:
But this throw the following error:
Error in fwrite(dataSet, file = "| /usr/bin/hadoop dfs -copyFromLocal -f - /pathToMyfile/test2.csv") :
No such file or directory: '| /usr/bin/hadoop dfs -copyFromLocal -f - /pathToMyfile/test2.csv'. Unable to create new file for writing (it does not exist already). Do you have permission to write here, is there space on the disk and does the path exist?
Something that I tryed successfully
I got my command by testing with R function write
write("test", file = "| /usr/bin/hadoop fs -copyFromLocal -f - /pathToMyfile/test2.csv",)
This work perfectly (meaning that I have writing access).
Please note, that here I am writting a string since write is not designed to write data.frame.
Something that I tryed without any success
I tried to repace fwrite
by write.csv
and write.table
but I got the same error.
I know that rhdfs package exist, but I can't install it