Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

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

New Contributor

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.

 

 

1 REPLY 1

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

Expert Contributor

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
    Extractors: 
    Loaders: 
  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

Don't have an account?
Coming from Hortonworks? Activate your account here