[ https://issues.apache.org/jira/browse/PIG-3367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13694465#comment-13694465 ]
Alex Levenson commented on PIG-3367: ------------------------------------ also: adding a keyword means that some scripts will fail (ones that had relations named assert) I remember that happening with the "rank" keyword. What's the big win from having this built into the language opposed to as a UDF? The potential to fail fast the entire script instead of letting each task fail one by one? Could a UDF (especially a new builtin one like this) have the same ability to fail fast the whole script? > Add assert keyword (operator) in pig > ------------------------------------ > > Key: PIG-3367 > URL: https://issues.apache.org/jira/browse/PIG-3367 > Project: Pig > Issue Type: New Feature > Components: parser > Reporter: Aniket Mokashi > Assignee: Aniket Mokashi > > Assert operator can be used for data validation. With assert you can write > script as following- > {code} > a = load 'something' as (a0:int, a1:int); > assert a by a0 > 0, 'a cant be negative for reasons'; > {code} > This script will fail if assert is violated. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira