Uploaded image for project: 'Sqoop'
  1. Sqoop
  2. SQOOP-3152

--map-column-hive to support DECIMAL(xx,xx)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.6
    • Fix Version/s: 1.4.7
    • Component/s: None
    • Labels:
      None

      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:

      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]*
      

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

        Attachments

        1. SQOOP-3152.2.patch
          6 kB
          Eric Lin
        2. SQOOP-3152.patch
          4 kB
          Eric Lin

          Activity

            People

            • Assignee:
              ericlin Eric Lin
              Reporter:
              ericlin Eric Lin
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: