Reply
New Contributor
Posts: 6
Registered: ‎11-10-2013

Problem importing table from mysql to Hive with sqoop: Hive does not support the SQL type

I'm trying to import a table from mysql to Hive with sqoop. It import the data, but don't create the hive table,  It shows this error:

 

13/12/19 15:15:55 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: Hive does not support the SQL type for column prov_id
at org.apache.sqoop.hive.TableDefWriter.getCreateTableStmt(TableDefWriter.java:181)
at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:187)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:425)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:502)
at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
at org.apache.sqoop.Sqoop.main(Sqoop.java:238)

 

 

The type from the original column is "varbinary", what can I do to import it?

Chi
Explorer
Posts: 7
Registered: ‎12-23-2013

Re: Problem importing table from mysql to Hive with sqoop: Hive does not support the SQL type

[ Edited ]

Considering the error message, it seems you are using sqoop 1 (terminal window). In that case, you can use the map-column-hive parameter to convert the varbinary type to a supported type. For instance, in your case

 

sqoop import --connect ....and so on
--map-column-hive prov_id=binary

 

Edit:  for references:

Sqoop User Guide

 

Announcements