New Contributor
Posts: 2
Registered: ‎10-21-2014

Can I use 'select * from table_x' sql to populate sqoop2 results? How?

I am trying to populate a configuration table using sqoop2.  I can use this if I provide specific columns.  But would prefer to use a generic 'select * from table_x' style instead if possible to accomidate any schema changes without having to recode additional columns throughout.  Is it possible to use a 'select *' style notation or use a 'table' option that would get everything.


Please indicate clearly which options to use to configure this in Hue interface for setting up Sqoop2 job.



Cloudera Employee abe
Cloudera Employee
Posts: 109
Registered: ‎08-08-2013

Re: Can I use 'select * from table_x' sql to populate sqoop2 results? How?

[ Edited ]

Yep. Try the following configuration:


sqoop:000> show job --all
1 job(s) to show: 
Job with id 1 and name MySQLtoHDFS (Enabled: true, Created by abe at 10/21/14 10:48 AM, Updated by abe at 10/21/14 10:48 AM)
Using link id 4 and Connector id 2
  From database configuration
    Schema name: 
    Table name: test
    Table SQL statement: 
    Table column names: 
    Partition column name: 
    Nulls in partition column: 
    Boundary query: 
  Throttling resources
  ToJob configuration
    Output format: TEXT_FILE
    Compression format: NONE
    Custom compression format: 
    Output directory: /tmp/sqoop/hdfs


Notice how only the Table name is provided in the From database configuration.


Here's what it will look like in Hue: 


Screen Shot 2014-10-21 at 3.57.30 PM.png

New solutions