Author: kathleen
Date: Mon May 14 04:42:54 2012
New Revision: 1338034
URL: http://svn.apache.org/viewvc?rev=1338034&view=rev
Log:
SQOOP-484. Update troubleshooting guide section about MySQL and TINYINT(1)
columns
(Jarek Jarcec Cecho via Kathleen Ting)
Modified:
sqoop/trunk/src/docs/user/troubleshooting.txt
Modified: sqoop/trunk/src/docs/user/troubleshooting.txt
URL:
http://svn.apache.org/viewvc/sqoop/trunk/src/docs/user/troubleshooting.txt?rev=1338034&r1=1338033&r2=1338034&view=diff
==============================================================================
--- sqoop/trunk/src/docs/user/troubleshooting.txt (original)
+++ sqoop/trunk/src/docs/user/troubleshooting.txt Mon May 14 04:42:54 2012
@@ -232,17 +232,16 @@ 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.
+MySQL: Import of TINYINT(1) from MySQL behaves strangely
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Problem: Sqoop is treating TINYINT(1) columns as booleans, which is for example
+causing issues with HIVE import. This is because by default the MySQL JDBC
connector
+maps the TINYINT(1) to java.sql.Types.BIT, which Sqoop by default maps to
Boolean.
-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.
+Solution: A more clean solution is to force MySQL JDBC Connector to stop
+converting TINYINT(1) to java.sql.Types.BIT by adding +tinyInt1isBit=false+
into your
+JDBC path (to create something like
+jdbc:mysql://localhost/test?tinyInt1isBit=false+).
+Another solution would be to 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.