sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject svn commit: r1303911 - /incubator/sqoop/trunk/src/docs/user/troubleshooting.txt
Date Thu, 22 Mar 2012 17:35:56 GMT
Author: jarcec
Date: Thu Mar 22 17:35:56 2012
New Revision: 1303911

URL: http://svn.apache.org/viewvc?rev=1303911&view=rev
SQOOP-463. Sqoop User Guide's troubleshooting section should explain how to override the column
mapping when importing a table from MySQL into Hive.

(Kathleen Ting via Jarek Jarcec Cecho)


Modified: incubator/sqoop/trunk/src/docs/user/troubleshooting.txt
URL: http://svn.apache.org/viewvc/incubator/sqoop/trunk/src/docs/user/troubleshooting.txt?rev=1303911&r1=1303910&r2=1303911&view=diff
--- incubator/sqoop/trunk/src/docs/user/troubleshooting.txt (original)
+++ incubator/sqoop/trunk/src/docs/user/troubleshooting.txt Thu Mar 22 17:35:56 2012
@@ -231,3 +231,18 @@ java.sql.SQLSyntaxErrorException: ORA-00
 Solution: Omit the option --driver oracle.jdbc.driver.OracleDriver and then
 re-run the Sqoop command.
+MySQL: Import of TINYINT(1) from MySQL to Hive does not work
+Problem: When importing a table from MySQL into Hive where one of the columns
+is of datatype TINYINT(1), Sqoop will automatically map this to the Hive
+datatype boolean. This is because the MySQL JDBC connector maps the
+TINYINT(1) datatype to java.sql.Types.BIT, which Sqoop by default maps to
+the Hive type Boolean. Consequently, if you have values such as 1 or 0 in
+this column, they will fail to parse correctly in Hive, instead appearing
+as all NULL values.
+Solution: Explicitly override the column mapping for the datatype TINYINT(1)
+column. For example, if the column name is foo, then pass the following
+option to Sqoop during import: --map-column-hive foo=tinyint. In the case of
+non-Hive imports to HDFS, use --map-column-java foo=integer.

View raw message