Search code examples
sqoophue

Sqoop Import using Hue - using inner query


I am trying to sqoop data in to hive table from mysql db in apache cloudera .

Below is the sqoop query that i am executing: sqoop import --connect jdbc:postgresql://localhost/test --username admin --password admin --incremental append --check-column sale_id --last-value 0 --query 'SELECT s.sale_id,c.cust_id,c.state,s.qty FROM customer c JOIN sales s on c.cust_id = s.cust_id WHERE $CONDITIONS' --split-by s.sale_id --hive-import --hive-table sales --target-dir /user/cloudera/sales_products --hive-delims-replacement '/t'

Query works fine when I execute it from command prompt/console. However when I am trying to execute same by HUE UI job designer I am getting below error: Error parsing arguments for import

I think it is because of $CONDITIONS argument.

Can you please let me know if it is possible to execute the same query using Hue and how it is feasible.

Thanks in advance,


Solution

  • Hue will submit this script through Oozie Sqoop Action. It has a particular way to specify the arguments.

    Hue also comes with a built in Sqoop example that you could try to modify with your import.