0
votes

I have been experimenting with Pig to access HBase with the HBaseStorage class. I am finding strange behavior with the means HBaseStorage employs to match columns. Consider the following example:

test = load 'hbase://resultstable' using org.apache.pig.backend.hadoop.hbase.HBaseStorage('foo:fail','-loadKey false') as (testresults:map[]);

It is certain that the column family 'foo' and the column name 'fail' exist and that records exist in this column. The query returns no records. However the following query returns records:

test = load 'hbase://resultstable' using org.apache.pig.backend.hadoop.hbase.HBaseStorage('foo:fail*','-loadKey false') as (testresults:map[]);

Note the difference between the two examples in that the latter uses 'foo:fail*' as a parameter. My guess is that there is a null terminator being stored in the column name and the binary exact match comparison fails because in the first example the null terminator is not explicitly passed (it shouldn't be in my opinion).

The column 'foo:fail' was created using standard HBase libraries via a java string containing the column name being passed to the appropriate HBase java API call.

Is this expected behavior? All the documentation (including the O'Reilly book) do not allude that it is.

Pig version is 0.13.0. HBase version is 0.94.10.

1

1 Answers

0
votes

You are incorrectly specifying the type in the first example. If you use a wildcard, it will be mapped to a map. If you specify a single column, it will be mapped to a scalar data type.