In my hdfs already exists the directory "mydatabase" and I am trying to update the data that is in mysql for hdfs with sqoop
However, in the import-all-tables command there is no overwrite option in the hdfs directory, only in hive
I'm trying to do the following command:
sqoop import-all-tables
--connect jdbc:mysql://10.20.20.43/mydatabase
--username blizzard
--password blizzard
--warehouse-dir /user/hdfs/mydatabase -m 1
--hive-database mydatabase
--hive-import
--hive-overwrite
--null-string '\\N'
--null-non-string '\\N'
--verbose
But I have an error:
17/05/03 19:48:13 ERROR tool.ImportAllTablesTool:
Encountered IOException running import job:
org.apache.hadoop.mapred.FileAlreadyExistsException:
Output directory hdfs://10.20.20.43:8020/user/hdfs/mydatabase/table1
already exists
I want to import all the data, always, because I do not know which one could have been changed or not.
What is the best way to do this?
Thanks!
Edit:
The --delete-target-dir
command is only for import
and not for import-all-tables
according to the documentation https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html