[Moving the thread to [email protected]. Please subscribe to this list]
Hi Hanjie, casting inside --query parameter should be working. I believe that your issue is caused by wrong column name that is retrieved from MySQL meta data and is passed to hive. Can you please try using SQL projection and rename casted column? Something like SELECT CAST(page_title AS CHAR(255)) AS page_title, ...? Jarcec On Sun, Jan 08, 2012 at 08:07:05PM -0800, Hanjie wrote: > Sorry I forgot to mention. I'm using Sqoop 1.4.1-incubating-SNAPSHOT > built with Hadoop 0.20.205 > > On Jan 8, 8:05 pm, Hanjie <[email protected]> wrote: > > I have following query performed through jdbc:mysql : > > > > --query 'SELECT CAST(page_title AS CHAR(255)), page_id, page_namespace > > from page WHERE $CONDITIONS LIMIT 100' > > > > And this is the error I got: > > hive.HiveImport: FAILED: Parse Error: line 1:56 cannot recognize input > > near 'CHAR' '(' '255' in column type > > > > page_title was stored as varbinary(255). > > Sqoop doesn't seem to support automatically convert varbinary(255) to > > string for the moment. I tried manually cast varbinary to char, which > > didn't work out either. Does sqoop support CAST in the query? > > > > Thank you very much! > > > > Hanjie > > -- > NOTE: The mailing list [email protected] is deprecated in favor of > Apache Sqoop mailing list [email protected]. Please subscribe > to it by sending an email to [email protected].
signature.asc
Description: Digital signature
