apache pig - Load data from Hbase with a Pig script without knowing the number of fields -
in hbase, have each row columns:
u1:chararray, u2:chararray, ..., un:chararray
in column family named u (from utable) number n can different each row. load these columns in tuples without naming them (for example using * character) don't see how so.
for time being create tuples following line:
qoe1 = load 'hbase://utable' using org.apache.pig.backend.hadoop.hbase.hbasestorage('u:u1, u:u2, u:u3', '-loadkey true') (id:chararray, u1:chararray, u2:chararray, u3:chararray);
but told before, unsatisfying because can load fixed number of columns.
any idea?
i ran same problem. solved following: if know column family names, can load columns fall under column family hbase pig using following. comes down putting columns (using *) in map:
result = load 'hbase://your_table_name' using org.apache.pig.backend.hadoop.hbase.hbasestorage('u:*', '-loadkey true') (id:bytearray, u:map[]) ;
Comments
Post a Comment