8.13. Sqoop Known Issues

  • BUG-25282: j.l.ArrayIndexOutOfBoundsException using --map-column-hive

    Problem: Running this command with the --map-column-hive statement:

    sqoop import --verbose --connect 
    'jdbc:mysql://sandbox.hortonworks.com/demo' --table customer_address --
    username carter --password password --create-hcatalog-table --hcatalog-
    table customer_address --hcatalog-storage-stanza "stored as orc" --map-
    column-hive fdsa -m 1

    Returns:

    2014-10-17 21:49:27,597 DEBUG sqoop.Sqoop (Sqoop.java:run(137)) - 1
    java.lang.ArrayIndexOutOfBoundsException: 1
    at org.apache.sqoop.SqoopOptions.parseColumnMapping(SqoopOptions.java:1196) 
    at org.apache.sqoop.SqoopOptions.setMapColumnHive(SqoopOptions.java:1201) 
    at org.apache.sqoop.tool.BaseSqoopTool.applyHiveOptions(BaseSqoopTool.java:1111) 
    at org.apache.sqoop.tool.ImportTool.applyOptions(ImportTool.java:961) 
    at org.apache.sqoop.tool.SqoopTool.parseArguments(SqoopTool.java:433) 
    at org.apache.sqoop.Sqoop.run(Sqoop.java:131) 
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) 
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179) 
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218) 
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227) 
    at org.apache.sqoop.Sqoop.main(Sqoop.java:236)

    There is no fdsa column. The command works without the --map-column-hive statement.

    Workaround: Sqoop is expecting comma separated list of mapping in form <name of column>=<new type>. For example: $ sqoop import ... --map-column-java id=String,value=Integer