Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Won't Fix
-
1.4.1-incubating
-
None
-
None
-
Ubuntu 10.04 ; mysql Server version: 5.1.41-3ubuntu12.10 (Ubuntu)
Description
If you try to join two tables that only have one column and both columns have the same name you get an error.
Example
actor | CREATE TABLE `actor` ( `actor_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`actor_id`) ) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8 |
CREATE TABLE `actor_test` (
`actor_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`actor_id`)
) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8
./sqoop import --connect jdbc:mysql://localhost/sakila -m1 --username sqoop --password sqoop --query 'SELECT a.,b. FROM actor a JOIN actor_test b ON a.actor_id=b.actor_id WHERE $CONDITIONS' --target-dir /user/eric/bugreport/
Warning: /usr/lib/hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
11/12/09 13:54:50 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
11/12/09 13:54:50 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
11/12/09 13:54:50 INFO tool.CodeGenTool: Beginning code generation
11/12/09 13:54:50 INFO manager.SqlManager: Executing SQL statement: SELECT a.,b. FROM actor a JOIN actor_test b ON a.actor_id=b.actor_id WHERE (1 = 0)
11/12/09 13:54:50 INFO manager.SqlManager: Executing SQL statement: SELECT a.,b. FROM actor a JOIN actor_test b ON a.actor_id=b.actor_id WHERE (1 = 0)
11/12/09 13:54:50 ERROR tool.ImportTool: Imported Failed: Duplicate Column identifier specified: 'actor_id'
This schema is a modified version of the sakila database from http://dev.mysql.com/doc/index-other.html
To recreate, load sakila database.
USE sakila;
CREATE TABLE actor_test LIKE actor;
INSERT INTO actor_test SELECT * FROM actor;
ALTER TABLE actor DROP first_name; ALTER TABLE actor DROP last_name; ALTER TABLE actor DROP last_update;
ALTER TABLE actor_test DROP first_name; ALTER TABLE actor_test DROP last_name; ALTER TABLE actor_test DROP last_update;