distcp 複製到同路徑下 複製到不同路徑下

2021-10-20 22:37:15 字數 760 閱讀 7727

複製到同路徑下:a/b/c-> a/b/c

distcp -pt hdfs://a/b/c/2021-02-01  hdfs://a/b/c/1900-01-01

結果是:

hdfs://a/b/c/1900-01-01/2021-02-01

2 這才是對的,直接複製檔案過來。

distcp -pt hdfs://a/b/c/2021-02-01/*  hdfs://a/b/c/1900-01-01

或者 distcp -pt hdfs://a/b/c/2021-02-01/*  hdfs://a/b/c/1900-01-01/

結果是:

hdfs://a/b/c/1900-01-01/2021-02-01_f1.lzo

hdfs://a/b/c/1900-01-01/2021-02-01_f2.lzo

複製到不同路徑下:a/b/c -> d/e/f

1 這也是直接複製檔案過來

distcp -pt hdfs://a/b/c/2021-02-01  hdfs://d/e/f/1900-01-01

或者distcp -pt hdfs://a/b/c/2021-02-01/*  hdfs://d/e/f/1900-01-01

結果是:

hdfs://a/b/c/1900-01-01/2021-02-01_f1.lzo

hdfs://a/b/c/1900-01-01/2021-02-01_f2.lzo

Distcp 複製多個源路徑

兩種方法 把源路徑依次寫在命令中 把源路徑寫到檔案中,上傳到hdfs,使用 distcp f ns1 source.txt dest 則能複製。把 ns1 abc sdk 2019 01 01 ns1 abc sdk 2019 01 02 ns1 abc sdk 2019 01 03 的資料拷貝到 ...

Array 複製到ArrayList中

string array new string arraylist list new arraylist 一 使用for迴圈,將array陣列中的資料逐步加入到arraylist的物件中 1 for迴圈 for int i 0 i array.length i 二 使用arraylist 的copy...

將檔案複製到指定路徑 C 檔案操作

將現有檔案複製到新檔案,不允許改寫現有檔案。c public fileinfo copyto string 將現有檔案複製到新檔案,允許改寫現有檔案。c public fileinfo copyto string,bool c 將檔案複製到指定路徑,允許改寫同名的目標檔案 copy using sy...