You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by praveenesh kumar <pr...@gmail.com> on 2015/12/09 13:21:58 UTC

Pig assert not working

Hi

I am trying to use pig asserts but it is not working at the moment. Not
sure if I am missing something

Pig statement

A = load '/tmp/testData' using PigStorage('!','-tagFile');
B = filter A by $1 matches '000RET123_ABC_XYZ\\s+.*WRONG_REGEX.*';

assert B by $0 is not NULL;
dump B;


I was expecting the job to fail and it should not let me do the dump as the
regex match will return empty. Just curious, Is there any other way to stop
the flow if the condition doesn't meet?

cat /tmp/testData

000RET123_ABC_XYZ          123ELECT1232
A!123!!23
B!23!123!322

Pig version - 0.15

Thanks
Prav