分享

CDH中oozie调用sqoop,hive-import失败

kingba 发表于 2018-2-5 10:49:14 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 2 5421
sqoop 抽取数据到HDFS 都没问题,执行hive 相关的参数脚本,报错。求指点。。。。

precise type in Hive
33763 [uber-SubtaskRunner] WARN  org.apache.sqoop.hive.TableDefWriter  - Column STATE had to be cast to a less precise type in Hive
33773 [uber-SubtaskRunner] INFO  org.apache.sqoop.hive.HiveImport  - Loading uploaded data into Hive
Heart beat
Intercepting System.exit(1)


<<< Invocation of Main class completed <<<

Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.SqoopMain], exit code [1]

Oozie Launcher failed, finishing Hadoop job gracefully

已有(2)人评论

跳转到指定楼层
nextuser 发表于 2018-2-5 14:39:31

回帖奖励 +1 云币

具体是怎么操作的。hdfs和hive分别都是如何写的。猜测可能跟数据类型有关系。
回复

使用道具 举报

einhep 发表于 2018-2-5 14:52:49
本帖最后由 einhep 于 2018-2-5 14:58 编辑

Column STATE had to be cast to a less precise type in Hive
上面其实已经说明了,需要对字段做下类型转换。
在sqoop的sql语句中加上cast.比如,你原先的数据为
select * from table。那么就不能在使用*了。就需要select所有字段
select a,b,c,cast("STATE " as 数据类型) from  table。
数据类型为hive的数据类型,不需要使用原先的。
相关参考
sqoop1 从sqlserver导出数据到HDFS报错
http://www.aboutyun.com/forum.php?mod=viewthread&tid=23891


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条