Review Board 1.7.22


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

Review Request #9300 - Created Feb. 5, 2013 and submitted

David Robson
trunk
SQOOP-862
Reviewers
Sqoop
sqoop-trunk
Added defensive code to skip the HBase put and warn the user if it has no columns and would therefore fail.
Before this change it was crashing the whole Sqoop job.
Tested manually and created a new automated test for this case.
src/docs/user/hbase.txt
Revision 7404929 New Change
[20] 45 lines
[+20]
46
using the default parameters from your HBase configuration.
46
using the default parameters from your HBase configuration.
47

    
   
47

   
48
Sqoop currently serializes all values to HBase by converting each field
48
Sqoop currently serializes all values to HBase by converting each field
49
to its string representation (as if you were importing to HDFS in text
49
to its string representation (as if you were importing to HDFS in text
50
mode), and then inserts the UTF-8 bytes of this string in the target
50
mode), and then inserts the UTF-8 bytes of this string in the target
51
cell.
51
cell. Sqoop will skip all rows containing null values in all columns

    
   
52
except the row key column.
52

    
   
53

   
53

    
   
54

   
src/java/org/apache/sqoop/hbase/HBasePutProcessor.java
Revision cca641f New Change
 
src/test/com/cloudera/sqoop/hbase/HBaseImportTest.java
Revision bf24608 New Change
 
src/test/com/cloudera/sqoop/hbase/HBaseTestCase.java
Revision 65ff87b New Change
 
  1. src/docs/user/hbase.txt: Loading...
  2. src/java/org/apache/sqoop/hbase/HBasePutProcessor.java: Loading...
  3. src/test/com/cloudera/sqoop/hbase/HBaseImportTest.java: Loading...
  4. src/test/com/cloudera/sqoop/hbase/HBaseTestCase.java: Loading...