sqoop 实现将postgresql表导入hive表

使用sqoop导入数据至hive常用语句

直接导入hive表

http://sqoop.apache.org/docs/1.4.2/SqoopUserGuide.html

最后优化后的sqoop语句为:


sqoop import –connect “jdbc:oracle:thin:@//localhost:1521/student” –password “***” –username “***” –query “select * from student where name=’zhangsan’ and class_id=’003′ and \$CONDITIONS” –target-dir “/user/hadoop/student” –fields-terminated-by “\001” –verbose -m 1

以上为个人经验,希望能给大家一个参考,也希望大家多多支持。如有错误或未考虑完全的地方,望不吝赐教。

发表评论

暂无评论
成为第一个留下见解的人