Sqoop export to sql failed


#1

Hi, The below code failed while trying to update the table in mysql by exporting file from hdfs to sql table through sqoop.

sqoop export --connect “jdbc:mysql://nn01.itversity.com/retail_export” --username retail_dba --password itversity --table departments_aparna --export-dir /user/aparna149/departments_export --batch --outdir java_files -m 1 --update-key department_id --update-mode allowinsert

Warning: /usr/hdp/2.5.0.0-1245/accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
17/11/27 06:24:20 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.5.0.0-1245
17/11/27 06:24:21 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
17/11/27 06:24:21 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
17/11/27 06:24:21 INFO tool.CodeGenTool: Beginning code generation
17/11/27 06:24:21 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM departments_aparna AS t LIMIT 1
17/11/27 06:24:21 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM departments_aparna AS t LIMIT 1
17/11/27 06:24:21 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /usr/hdp/2.5.0.0-1245/hadoop-mapreduce
Note: /tmp/sqoop-aparna149/compile/7575df3a9bb433306f1f2cf3272a6327/departments_aparna.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
17/11/27 06:24:22 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-aparna149/compile/7575df3a9bb433306f1f2cf3272a6327/departments_aparna.jar
17/11/27 06:24:22 WARN manager.MySQLManager: MySQL Connector upsert functionality is using INSERT ON
17/11/27 06:24:22 WARN manager.MySQLManager: DUPLICATE KEY UPDATE clause that relies on table’s unique key.
17/11/27 06:24:22 WARN manager.MySQLManager: Insert/update distinction is therefore independent on column
17/11/27 06:24:22 WARN manager.MySQLManager: names specified in --update-key parameter. Please see MySQL
17/11/27 06:24:22 WARN manager.MySQLManager: documentation for additional limitations.
17/11/27 06:24:22 INFO mapreduce.ExportJobBase: Beginning export of departments_aparna
17/11/27 06:24:24 INFO impl.TimelineClientImpl: Timeline service address: http://rm01.itversity.com:8188/ws/v1/timeline/
17/11/27 06:24:24 INFO client.RMProxy: Connecting to ResourceManager at rm01.itversity.com/172.16.1.106:8050
17/11/27 06:24:24 INFO client.AHSProxy: Connecting to Application History server at rm01.itversity.com/172.16.1.106:10200
17/11/27 06:24:30 INFO input.FileInputFormat: Total input paths to process : 1
17/11/27 06:24:30 INFO input.FileInputFormat: Total input paths to process : 1
17/11/27 06:24:31 INFO mapreduce.JobSubmitter: number of splits:1
17/11/27 06:24:31 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1507687444776_15683
17/11/27 06:24:32 INFO impl.YarnClientImpl: Submitted application application_1507687444776_15683
17/11/27 06:24:32 INFO mapreduce.Job: The url to track the job: http://rm01.itversity.com:8088/proxy/application_1507687444776_15683/
17/11/27 06:24:32 INFO mapreduce.Job: Running job: job_1507687444776_15683
17/11/27 06:24:41 INFO mapreduce.Job: Job job_1507687444776_15683 running in uber mode : false
17/11/27 06:24:41 INFO mapreduce.Job: map 0% reduce 0%
17/11/27 06:24:48 INFO mapreduce.Job: map 100% reduce 0%
17/11/27 06:24:49 INFO mapreduce.Job: Job job_1507687444776_15683 failed with state FAILED due to: Task failed task_1507687444776_15683_m_000000
Job failed as tasks failed. failedMaps:1 failedReduces:0

17/11/27 06:24:49 INFO mapreduce.Job: Counters: 8
Job Counters
Failed map tasks=1
Launched map tasks=1
Rack-local map tasks=1
Total time spent by all maps in occupied slots (ms)=8760
Total time spent by all reduces in occupied slots (ms)=0
Total time spent by all map tasks (ms)=4380
Total vcore-milliseconds taken by all map tasks=4380
Total megabyte-milliseconds taken by all map tasks=8970240
17/11/27 06:24:49 WARN mapreduce.Counters: Group FileSystemCounters is deprecated. Use org.apache.hadoop.mapreduce.FileSystemCounter instead
17/11/27 06:24:49 INFO mapreduce.ExportJobBase: Transferred 0 bytes in 25.5237 seconds (0 bytes/sec)
17/11/27 06:24:49 WARN mapreduce.Counters: Group org.apache.hadoop.mapred.Task$Counter is deprecated. Use org.apache.hadoop.mapreduce.TaskCounter instead
17/11/27 06:24:49 INFO mapreduce.ExportJobBase: Exported 0 records.
17/11/27 06:24:49 ERROR mapreduce.ExportJobBase: Export job failed!
17/11/27 06:24:49 ERROR tool.ExportTool: Error during export: Export job failed!

Kindly look into this and let me know what is the error?

Thanks in advance