sqoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 刘光胜 <liuguangsh...@uxin.com>
Subject export from hdfs to mysql when has a auto_increment field
Date Wed, 15 Jan 2014 03:41:44 GMT
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