Created 12-07-2016 12:15 PM
How to execute multiple SQL queries with Sqoop import --query command? Also what is the maximum size of query string?
Created 12-07-2016 03:41 PM
The sqoop import --query option is intended to process a single statement and there are warnings about using complex queries.
The facility of using free-form query in the current version of Sqoop is limited to simple queries where there are no ambiguous projections and no OR conditions in the WHERE clause. Use of complex queries such as queries that have sub-queries or joins leading to ambiguous projections can lead to unexpected results.
A few more details are at this URL:
https://sqoop.apache.org/docs/1.4.2/SqoopUserGuide.html#_free_form_query_imports
Created 12-07-2016 03:41 PM
The sqoop import --query option is intended to process a single statement and there are warnings about using complex queries.
The facility of using free-form query in the current version of Sqoop is limited to simple queries where there are no ambiguous projections and no OR conditions in the WHERE clause. Use of complex queries such as queries that have sub-queries or joins leading to ambiguous projections can lead to unexpected results.
A few more details are at this URL:
https://sqoop.apache.org/docs/1.4.2/SqoopUserGuide.html#_free_form_query_imports
Created 12-07-2016 04:01 PM
Thanks Terry. What is the alternate solution to execute multiple sql query ?
Created 12-07-2016 04:43 PM
You are welcome Mahendra. I think you will have to push the complex query to the database and place those results into a different table and then perform the sqoop command on that table. Best of luck.
Created 12-08-2016 07:14 AM
How about create views in source databases.