Try the bincond operator. Something like this might work:
...
test_count = FOREACH (GROUP test ALL) GENERATE COUNT(test) AS total;
test_count_2 = FOREACH test_count GENERATE id, valid, (total IS NULL ? 0 :
total);
DUMP test_count_2;
-Peter
From: Marco Brinkm
I'm new to pig and I'm getting a ClassCastException when I try to run the
following script in pig 0.11.1:
A = LOAD 'test.log' AS (timestamp:long, pk_id:int, array_field:chararray,
fk_id:int);
B = FOREACH A GENERATE timestamp, pk_id, FLATTEN(STRSPLIT(array_field,',')) AS
(field1:chararray, fie
I'm using pig 0.11.1 to load about 100 rows into mysql using DBStorage. If I
run my script from grunt everything works fine and the rows are committed. If I
run pig in batch mode the script says it was successful, but no rows are in the
database table. If I run the script in batch mode with the