sqoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jarek Jarcec Cecho <jar...@apache.org>
Subject Re: export from hdfs to mysql when has a auto_increment field
Date Mon, 20 Jan 2014 17:41:17 GMT
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!
> 
> 
> 
> 
> happyshelocks@gmail.com

Mime
View raw message