Skip to content

Commit

Permalink
0004276: HBase data loader support for null values in source
Browse files Browse the repository at this point in the history
  • Loading branch information
jumpmind-josh committed Feb 6, 2020
1 parent 4b34101 commit fa3d54f
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -4,6 +4,7 @@
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseConfiguration;
Expand Down Expand Up @@ -65,7 +66,8 @@ protected LoadStatus put(CsvData data) {
byte[] columnFamily = split[0].getBytes();
byte[] columnName = split[1].getBytes();

put.addColumn(columnFamily, columnName, values[i].getBytes());
byte[] value = StringUtils.isEmpty(values[i]) ? new byte[0] : values[i].getBytes();
put.addColumn(columnFamily, columnName, value);
putList.add(put);
}
}
Expand Down

0 comments on commit fa3d54f

Please sign in to comment.