Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-3367

Add assert keyword (operator) in pig

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.12.0
    • Component/s: parser
    • Labels:
      None

      Description

      Assert operator can be used for data validation. With assert you can write script as following-

      a = load 'something' as (a0:int, a1:int);
      assert a by a0 > 0, 'a cant be negative for reasons';
      

      This script will fail if assert is violated.

        Attachments

        1. PIG-3367-2.patch
          10 kB
          Aniket Mokashi
        2. PIG-3367.patch
          12 kB
          Aniket Mokashi

          Issue Links

            Activity

              People

              • Assignee:
                aniket486 Aniket Mokashi
                Reporter:
                aniket486 Aniket Mokashi
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: