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

Hbase import fails if there is a row where all columns are null

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.3
    • Component/s: None
    • Labels:
      None

      Description

      If you try to import a table where any of the rows contain all null values (except for the primary key), the import fails. For example create the following table in Oracle:

      CREATE TABLE employee(id number primary key, test_number number);
      INSERT INTO employee values(1, 123);
      INSERT INTO employee values(2, null);
      COMMIT;

      Then run an import:

      sqoop import --connect jdbc:oracle:thin:@//HOSTNAME/SERVICE --username USERNAME --table EMPLOYEE --password PASSWORD --hbase-table EMPLOYEE --column-family tst --hbase-create-table

      The Import fails with:

      java.lang.IllegalArgumentException: No columns to insert
      at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:400)
      Caused by: java.lang.IllegalArgumentException: No columns to insert
      at org.apache.hadoop.hbase.client.HTable.validatePut(HTable.java:950)
      at org.apache.hadoop.hbase.client.HTable.doPut(HTable.java:766)
      at org.apache.hadoop.hbase.client.HTable.put(HTable.java:752)
      at org.apache.sqoop.hbase.HBasePutProcessor.accept(HBasePutProcessor.java:127)
      at org.apache.sqoop.mapreduce.DelegatingOutputFormat$DelegatingRecordWriter.write(DelegatingOutputFormat.java:128)
      at org.apache.sqoop.mapreduce.DelegatingOutputFormat$DelegatingRecordWriter.write(DelegatingOutputFormat.java:1)
      at org.apache.hadoop.mapred.MapTask$NewDirectOutputCollector.write(MapTask.java:598)
      at org.apache.hadoop.mapreduce.task.TaskInputOutputContextImpl.write(TaskInputOutputContextImpl.java:89)
      at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.write(WrappedMapper.java:112)
      at org.apache.sqoop.mapreduce.HBaseImportMapper.map(HBaseImportMapper.java:38)
      at org.apache.sqoop.mapreduce.HBaseImportMapper.map(HBaseImportMapper.java:1)
      at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
      at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:64)
      at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:725)
      at org.apache.hadoop.mapred.MapTask.run(MapTask.java:332)
      at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:232)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)

        Attachments

        1. SQOOP-862.patch
          4 kB
          David Robson
        2. SQOOP-862.patch
          4 kB
          David Robson

          Issue Links

            Activity

              People

              • Assignee:
                david.robson David Robson
                Reporter:
                david.robson David Robson
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: