Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
If a NULL DataBag is passed to org.apache.pig.builtin.TOP then a NPE is thrown. Consider:
$: cat foo.tsv a {(foo,1),(bar,2)} b c {(fyha,4),(asdf,9)}
then:
data = LOAD 'foo.tsv' AS (key:chararray, a_bag:bag {t:tuple (name:chararray, value:int)}); tpd = FOREACH data { top_n = TOP(1, 1, a_bag); GENERATE key AS key, top_n AS top_n ; }; DUMP tpd;
will throw an NPE when it gets to the row with no bag.