I believe that you can use parameter --columns to specify what subset of 
columns is available in the file on HDFS.

Jarcec

On Wed, Jan 15, 2014 at 11:41:44AM +0800, 刘光胜 wrote:
> hi everyone ,is there any way to do this  export using sqoop/sqoop2
> 
> hdfs file like this:
> (name   uid     url)
> 
> bill,123,www.good.com
> tony,321,www.bad.com
> .....
> 
> mysql table like this:
> 
> mysql> select * from page;
> +----+----------+-----+----------------+
> | id    | name     |    uid | url                   |
> +----+----------+-----+----------------+
> |  1    | shelocks | 123  | www.abc.com |
> +----+----------+-----+----------------+
> 1 row in set (0.00 sec)
> 
> mysql> desc page;
> +-------+--------------+------+-----+---------+----------------+
> | Field | Type         | Null | Key | Default | Extra          |
> +-------+--------------+------+-----+---------+----------------+
> | id        | int(3)             | NO   | PRI | NULL    | auto_increment |
> | name  | char(10)        | NO   |       | NULL    |                |
> | uid      | int(10)           | NO   |       | NULL    |                |
> | url       | varchar(126) | NO   |       | NULL    |                |
> +-------+--------------+------+-----+---------+----------------+
> 4 rows in set (0.00 sec)
> 
> the table has a auto_increment  field,but hdfs not.is there any way to 
> export hdfs to mysql table?
> 
> thanks!
> 
> 
> 
> 
> [email protected]

Attachment: signature.asc
Description: Digital signature

Reply via email to