Re: Count empty relation after filtering

2013-05-29 Thread Peter Connolly
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

ClassCastException with bincond operator

2013-05-03 Thread Peter Connolly
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

DBStorage doesn't commit in batch mode

2013-05-03 Thread Peter Connolly
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