Copies a file from HDFS to the local file system.
The name of a file in HDFS. The file name can include a path that is either absolute or relative to the current path.
The name of a file in the local file system where the data is copied.
Controls whether the operation can overwrite an existing local file. Set to TRUE
to overwrite filename
, or FALSE
to signal an error (default).
This function provides the fastest and easiest way to copy a file from HDFS. No data transformations occur except merging multiple parts into a single file. The local file has the exact same data as the HDFS file.
This example displays a list of files in the current HDFS directory and copies ontime2000.DB to the local file system as /home/oracle/ontime2000.dat.
R> hdfs.ls() [1] "ontime2000_DB" "ontime_DB" "ontime_File" "ontime_R" "testdata.dat" R> tmpfile <- hdfs.download("ontime2000_DB", "/home/oracle/ontime2000.dat", overwrite=F) R> tmpfile [1] "/home/oracle/ontime2000.dat"