sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Lin <eric....@cloudera.com>
Subject Re: Review Request 57576: SQOOP-3152 - --map-column-hive to support DECIMAL(xx, xx)
Date Mon, 20 Mar 2017 08:25:38 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57576/
-----------------------------------------------------------

(Updated March 20, 2017, 8:25 a.m.)


Review request for Sqoop, Attila Szabo and Szabolcs Vasas.


Changes
-------

added test case in class TestHiveImport


Repository: sqoop-trunk


Description
-------

The following command:

sqoop import --connect jdbc:mysql://localhost/test --username root --password 'cloudera' --table
decimal_table  -m 1 --driver com.mysql.jdbc.Driver --verbose --hive-import --hive-database
default --hive-table decimal_table --hive-overwrite --map-column-hive a='DECIMAL(10,4)'

will fail with below error:

{code}
17/03/13 18:42:09 DEBUG sqoop.Sqoop: Malformed mapping.  Column mapping should be the form
key=value[,key=value]*
java.lang.IllegalArgumentException: Malformed mapping.  Column mapping should be the form
key=value[,key=value]*
	at org.apache.sqoop.SqoopOptions.parseColumnMapping(SqoopOptions.java:1333)
	at org.apache.sqoop.SqoopOptions.setMapColumnHive(SqoopOptions.java:1349)
	at org.apache.sqoop.tool.BaseSqoopTool.applyHiveOptions(BaseSqoopTool.java:1198)
	at org.apache.sqoop.tool.ImportTool.applyOptions(ImportTool.java:1011)
	at org.apache.sqoop.tool.SqoopTool.parseArguments(SqoopTool.java:435)
	at org.apache.sqoop.Sqoop.run(Sqoop.java:135)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
	at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
	at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
Malformed mapping.  Column mapping should be the form key=value[,key=value]*
{code}

--map-column-hive should support DECIMAL(10,5) format.


Diffs (updated)
-----

  src/java/org/apache/sqoop/SqoopOptions.java b33b54b 
  src/test/com/cloudera/sqoop/hive/TestHiveImport.java 1d67a2d 
  src/test/com/cloudera/sqoop/hive/TestTableDefWriter.java 4db629f 
  testdata/hive/scripts/decimalMapImport.q PRE-CREATION 


Diff: https://reviews.apache.org/r/57576/diff/2/

Changes: https://reviews.apache.org/r/57576/diff/1-2/


Testing
-------

Added test case + manual testing


Thanks,

Eric Lin


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message