Hue: run sqoop free query

When run a sqoop job in hue. The is a error:


Hue: run sqoop free query
 

The sqoop job likes:


Hue: run sqoop free query
 Root Cause:

The Sqoop command can be specified either using the command element or multiple arg elements.

When using the command element, Oozie will split the command on every space into multiple arguments.

When using the arg elements, Oozie will pass each argument value as an argument to Sqoop.

The arg variant should be used when there are spaces within a single argument.

 

 NOTE: The arg elements syntax, while more verbose, allows to have spaces in a single argument, something useful when using free from queries.

 

 When importing a free-form query, you must specify a destination directory with --target-dir.

 When using --hive-import, the --target-dir will be a stage dir which will be deleted from hdfs after data loaded to hive. so I use  /user/zhaohj/hive/warehouse/inok_raw.db/xx

 

Solution: When use sqoop free query, you need use parameters not fill the commnads in 'commnd' panel.

Just like:


Hue: run sqoop free query
 

 --query

SELECT user_id, GROUP_CONCAT(target_userid SEPARATOR ',') AS fans  FROM inok_friend WHERE relation=6 AND $CONDITIONS GROUP BY user_id;

 

 

Reference

https://oozie.apache.org/docs/3.3.0/DG_SqoopActionExtension.html