Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Highlighted

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

New Contributor

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?

1 REPLY 1

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

Explorer

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

 

Don't have an account?
Coming from Hortonworks? Activate your account here