Already existing error and usage of connection-param file

#1

Hi,
I have 2 questions.

  1. How can we use connection-param in sqoop.

  2. When I was running below command, there is nothing in hdfs location under my username. And after that I ran below command I got AlreadyExistsException(message:Table customers already exists)

Even though i used hive-overwrite option y I am getting this error.

sqoop import-all-tables
–num-mappers 1
–connect “jdbc:mysql://nn01.itversity.com:3306/retail_db”
–username=retail_dba
–password=itversity
–hive-import
–hive-overwrite
–create-hive-table
–compress
–compression-codec org.apache.hadoop.io.compress.SnappyCodec
–outdir java_files

0 Likes

#2

@RaghavendraKumars If the sqoop import is failed anytime it creates a temporary file( the location will be shown in error message). We have to delete and then start importing again.

0 Likes

#3

@santhoshpottumuthu6 this issue is different. It is giving error table already exists.

@RaghavendraKumars, hive table already exists. You have to remove --create-hive-table or drop the hive table and re-run the command.

0 Likes

#4

ok hive-overwritten for just overwrite the data. not to recreate the table already existing. Got it.

0 Likes