sqoop将数据从hive到mysql报错ERROR mapreduce.ExportJobBase: Export job failed!

博客讲述了在使用sqoop从hive导数据到mysql时遇到的ERROR ExportJobBase: Export job failed!错误。问题源于分隔符设置不当, 作为分隔符导致所有字段被塞入第一个,其余为null。解决方案是将分隔符改为01,确保正确对应建表语句中的字段,避免null值问题。
摘要由CSDN通过智能技术生成

报错如下

20/08/14 10:57:43 INFO mapreduce.Job: Job job_1595919753289_4416 failed with state FAILED due to: Task failed task_1595919753289_4416_m_000000
Job failed as tasks failed. failedMaps:1 failedReduces:0 killedMaps:0 killedReduces: 0

20/08/14 10:57:43 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)=4340
                Total time spent by all reduces in occupied slots (ms)=0
                Total time spent by all map tasks (ms)=4340
                Total vcore-milliseconds taken by all map tasks=4340
                Total megabyte-milliseconds taken by all map tasks=4444160
20/08/14 10:57:43 WARN mapreduce.Counters: Group FileSystemCounters is deprecated. Use org.apache.hadoop.mapreduce.FileSystemCounter instead
20/08/14 10:57:43 INFO mapreduce.ExportJobBase: Transferred 0 bytes in 16.7826 seconds (0 bytes/sec)
20/08/14 10:57:43 WARN mapreduce.Counters: Group org.apache.hadoop.mapred.Task$Counter is deprecated. Use org.apache.hadoop.mapreduce.TaskCounter instead
20/08/14 10:57:43 INFO mapreduce.ExportJobBase: Exported 0 records.
20/08/14 10:57:43 ERROR mapreduce.ExportJobBase: Export job failed!
20/08/14 10:57:43 ERROR tool.ExportTool: Error during export:
Export job failed!
        at org.apache.sqoop.mapreduce.ExportJobBase.runExport(ExportJobBase.java:444)
        at org.apache.sqoop.manager.MySQLManager.upsertTable(MySQLManager.java:142)
        at org.apache.sqoop.tool.ExportTool.exportTable(ExportTool.java:86)
        at org.apache.sqoop.tool.ExportTool.run(ExportTool.java:112)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:146)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:182)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:233)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:242)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:251)
shell命令执行错误

查看hive执行日志发现如下报错

2020-08-14 10:57:42,004 ERROR [IPC Server handler 0 on 35343] org.apache.hadoop.mapred.TaskAttemptListenerImpl: Task: attempt_1595919753289_4416_m_000000_0 - exited : java.io.IOException: Can't export data, please check failed map task logs
	at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:121)
	at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:38)
	at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:146)
	at org.apache.sqoop.mapreduce.AutoProgressMapper.run(Au
2023-06-10 06:10:14,356 INFO mapreduce.Job: Job job_1686300831839_0056 failed with state FAILED due to: Task failed task_1686300831839_0056_m_000001 Job failed as tasks failed. failedMaps:1 failedReduces:0 killedMaps:0 killedReduces: 0 2023-06-10 06:10:14,536 INFO mapreduce.Job: Counters: 9 Job Counters Failed map tasks=1 Killed map tasks=3 Launched map tasks=4 Data-local map tasks=4 Total time spent by all maps in occupied slots (ms)=20374 Total time spent by all reduces in occupied slots (ms)=0 Total time spent by all map tasks (ms)=20374 Total vcore-milliseconds taken by all map tasks=20374 Total megabyte-milliseconds taken by all map tasks=20862976 2023-06-10 06:10:14,561 WARN mapreduce.Counters: Group FileSystemCounters is deprecated. Use org.apache.hadoop.mapreduce.FileSystemCounter instead 2023-06-10 06:10:14,566 INFO mapreduce.ExportJobBase: Transferred 0 bytes in 19.7479 seconds (0 bytes/sec) 2023-06-10 06:10:14,582 WARN mapreduce.Counters: Group org.apache.hadoop.mapred.Task$Counter is deprecated. Use org.apache.hadoop.mapreduce.TaskCounter instead 2023-06-10 06:10:14,582 INFO mapreduce.ExportJobBase: Exported 0 records. 2023-06-10 06:10:14,582 ERROR mapreduce.ExportJobBase: Export job failed! 2023-06-10 06:10:14,585 ERROR tool.ExportTool: Error during export: Export job failed! at org.apache.sqoop.mapreduce.ExportJobBase.runExport(ExportJobBase.java:445) at org.apache.sqoop.manager.SqlManager.exportTable(SqlManager.java:931) at org.apache.sqoop.tool.ExportTool.exportTable(ExportTool.java:80) at org.apache.sqoop.tool.ExportTool.run(ExportTool.java:99) at org.apache.sqoop.Sqoop.run(Sqoop.java:147) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243) at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
06-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值