Apache Sqoop Cookbook by Kathleen Ting & Jarek Jarcec Cecho

Apache Sqoop Cookbook by Kathleen Ting & Jarek Jarcec Cecho

Author:Kathleen Ting & Jarek Jarcec Cecho [Kathleen Ting and Jarek Jarcec Cecho]
Language: eng
Format: epub
Tags: COMPUTERS / Database Management / General
ISBN: 9781449364571
Publisher: O’Reilly Media
Published: 2013-07-01T16:00:00+00:00


Solution

You can specify any valid query to fetch minimum and maximum values of the --split-by column using the --boundary-query parameter:

sqoop import \ --connect jdbc:mysql://mysql.example.com/sqoop \ --username sqoop \ --password sqoop \ --query 'SELECT normcities.id, \ countries.country, \ normcities.city \ FROM normcities \ JOIN countries USING(country_id) \ WHERE $CONDITIONS' \ --split-by id \ --target-dir cities \ --boundary-query "select min(id), max(id) from normcities"

Discussion



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.