版本四sqoop语句:
sqoop import --connect jdbc:postgresql://192.168.xxx.xxx:5432/xxxxxxdb
–username xxxxxx --password xxxxxxxx
–query "select id,check_code,lastupdatetime,check_num,report_name,json_object_keys(reportinfo) from check_report where reportinfo::Text<>‘null’ and \$CONDITIONS "
–delete-target-dir
–target-dir /user/hive/warehouse/lmj_test.db/mid_yyts_report_analyze
–fields-terminated-by ‘\001’
–null-string ‘’
–null-non-string ‘’
-m1
-m1一个mapreduce
结论
也就是说,当我们用sqoop,并且采用query的时候,我们最好使用双引号,而且如果有where语句,必须加上“\CONDITIONS”,注意有“\”
参考原文csdn链接:
https://blog.youkuaiyun.com/IKnowNothinglee/article/details/90640912
sqoop一些常用命令及参数
https://www.cnblogs.com/alexzhang92/p/10927884.html