sqoop从hive中导出oracle数据

1.从hive上导出数据到oracle时,报如下错误

执行语句:

sqoop export --connect jdbc:oracle:thin:@192.168.0.113:1521:cyanalyse --username xxxxxxx--password xxxxxx --table sms_count  --export-dir /user/hive/hivedata/user_count --input-fields-terminated-by '\001'

错误信息:

14/10/21 11:18:16 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.IllegalArgumentException: Attempted to generate class with no columns!
java.lang.IllegalArgumentException: Attempted to generate class with no columns!


修改如下:

sqoop export --connect jdbc:oracle:thin:@192.168.0.113:1521:cyanalyse --username xxxxxxx--password xxxxxx --table sms_count --columns userid,sms_count --export-dir /user/hive/hivedata/user_count --input-fields-terminated-by '\001'

修改后能正确执行。

你可能感兴趣的:(Hive)