I have three tables in mysql named movie, moviegenre, genre. When i try to import them into hdfs using sqoop free-form query:
sqoop import --connect jdbc:mysql://localhost/movielens --username user --password ***
--query 'select m.id as id,m.name as movie_name,m.year as year, g.name as genre_name
from movie m join moviegenre mg on m.id = mg.movieid join genre g on g.id = mg.genreid
WHERE $CONDITIONS' --split-by m.id --target-dir /user/sqoop/moviegenre
it throws error:
Imported Failed: Duplicate Column Identifier specified: 'name'.
When I write the same query in mysql it gives me output, which is what I want:
id movie_name year genre_name
1 Toy Story 1995 Animation
2 Jumanji 1995 Adventure
.. ....... .... ........
I followed this link and did exactly as answer : Imported Failed: Duplicate Column Identifier specified (sqoop) but that didn't seem to help either.
Fields in the tables are as follow : movie = id, name, year
genre = id, name
moviegenre = movieid, genreid
Please point out the mistake in my query.
Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered