DEFINE incr(A, fld, num) RETURNS B {
$B = foreach A generate k, ($fld + (long)$num) as (v:long);
}
A = load 'hbase://t1' using org.apache.pig.backend.hadoop.hbase.HBaseStorage(
'f1:c1', '-caster=HBaseBinaryConverter -loadKey=true') as (k:chararray, v:long);
B = incr(A,v,3); --increment f1:c1 by 3
store B into 'hbase://t1' using org.apache.pig.backend.hadoop.hbase.HBaseStorage(
'f1:c1', '-caster=HBaseBinaryConverter -loadKey=true');
1条答案
按热度按时间knpiaxh11#
您可以为此创建宏: