- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to execute multiple SQL queries with Sqoop import --query command? Also what is the maximum size of query string?
- Labels:
-
Apache Sqoop
Created ‎12-07-2016 12:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Terry. What is the alternate solution to execute multiple sql query ?
Created ‎12-07-2016 04:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How about create views in source databases.
