apache pig - Perform arithmetic operation Pig -
i want make query hbase pig. rowkeys stored using reverse timestamp (long.max_value - timestamp
). pig script, want store in variable current date in format (long.max_value - currenttime
) query.
load 'mydata' using org.apache.pig.backend.hadoop.hbase.hbasestorage('d:column', '-caster=hbasebinaryconverter -gte $minrowkey* -lte $maxrowkey -loadkey true' ) (rowkey:chararray,json:chararray);
so this:
%default maxrowkey "date +%s"
and perform subtraction long.max_value - maxrowkey
query. possible ?
thanks
i did not know of existence of hbasestorage options:
-mintimestamp= scan's timestamp min timerange
-maxtimestamp= scan's timestamp max timerange
that did trick me.
Comments
Post a Comment