Pig
  1. Pig
  2. PIG-3367

Add assert keyword (operator) in pig

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major 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.

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

        Issue Links

          Activity

          Daniel Dai made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Cheolsoo Park made changes -
          Link This issue is related to PIG-3483 [ PIG-3483 ]
          Aniket Mokashi made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Aniket Mokashi made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Aniket Mokashi made changes -
          Attachment PIG-3367-2.patch [ 12603688 ]
          Aniket Mokashi made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Aniket Mokashi made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Aniket Mokashi made changes -
          Attachment PIG-3367.patch [ 12601568 ]
          Aniket Mokashi made changes -
          Fix Version/s 0.12 [ 12323380 ]
          Aniket Mokashi made changes -
          Labels 0
          Aniket Mokashi made changes -
          Labels 0
          Aniket Mokashi made changes -
          Assignee Aniket Mokashi [ aniket486 ]
          Aniket Mokashi made changes -
          Description 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, ';
          {code}
          This script will fail if assert is violated.
          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.
          Aniket Mokashi made changes -
          Field Original Value New Value
          Description 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;
          {code}
          This script will fail if assert is violated.
          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, ';
          {code}
          This script will fail if assert is violated.
          Aniket Mokashi created issue -

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development