[ https://issues.apache.org/jira/browse/PIG-3367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13872480#comment-13872480 ]
Daniel Dai commented on PIG-3367: --------------------------------- Seems the syntax: {code} assert a by a0 > 0, 'a cant be negative for reasons'; {code} does not work, Grunt parser will complain. We will need to use the following syntax: {code} b = assert a by a0 > 0, 'a cant be negative for reasons'; {code} Is that expected? > 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 > Fix For: 0.12.0 > > Attachments: PIG-3367-2.patch, PIG-3367.patch > > > 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 was sent by Atlassian JIRA (v6.1.5#6160)