牛骨文教育服务平台(让学习变的简单)
博文笔记

SQOOP从Oracle导入数据到Hive时hang up在MapReduce作业过程

创建时间:2016-10-21 投稿人: 浏览次数:813

打算从Oracle一个模式中导入数据到Hive,打算导入的数据都存在视图里。

其他几个视图的导入过程都很顺利,有一个小坑是如果没有设置split-by column选项,只能用一个mapper(--num-mappers 1)。

基本语句为

sqoop import --hive-import --connect jdbc:oracle:thin:@//192.168.1.1:1521/orcl --username XXX --password XXX -m 1 --table DB.VIEW --as-textfile --hive-overwrite --create-hive-table --fields-terminated-by \t --hive-table database.table --null-string "\N" --null-non-string "\N";

但是有一个任务在执行MR时候一直卡死,状态是:

 INFO [IPC Server handler 23 on 50949] org.apache.hadoop.mapred.TaskAttemptListenerImpl: Progress of TaskAttempt attempt_1474343967582_0462_m_000000_0 is : 0.0

INFO [IPC Server handler 26 on 50949] org.apache.hadoop.mapred.TaskAttemptListenerImpl: Progress of TaskAttempt attempt_1474343967582_0462_m_000000_0 is : 0.0
INFO [IPC Server handler 25 on 50949] org.apache.hadoop.mapred.TaskAttemptListenerImpl: Progress of TaskAttempt attempt_1474343967582_0462_m_000000_0 is : 0.0

完成一直是0.0。

后来看了下数据库,发现这个视图中有一列需要从其他表抽取数据并经过大量计算。

结果选择除了这个列以外的列进行导入,任务顺利跑完。

最后把这个视图需要大量计算的列放到Hive里去跑。

声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。