2016-10-19 11 views

答えて

5

使用--delete-target-dir

(私たちは「--overwrite」我々はハイブ輸入のために持っているように、「--hive-上書き」などの任意のオプションを持っています)ディレクトリ。

1

使用この:--delete-target-dir

これはsqoop構文を使用してHDFSディレクトリを上書きするために動作します:

$ sqoop import --connect jdbc:mysql://localhost/dbname --username username -P --table tablename --delete-target-dir --target-dir '/targetdirectorypath' -m 1 

例:

$ sqoop import --connect jdbc:mysql://localhost/abc --username root -P --table empsqooptargetdel --delete-target-dir --target-dir '/tmp/sqooptargetdirdelete' -m 1 

このコマンドは、対応するHDFSディレクトリまたはハイブを更新しますこのコマンドが実行されるたびに、更新された/最新のデータでテーブルのデータが更新されます。

関連する問題