Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.7.0
    • Fix Version/s: 0.10.0
    • Component/s: data
    • Hadoop Flags:
      Reviewed
    • Release Note:
      Hide
      Introduce boolean as first class Pig data type. You can use "boolean" anywhere Pig expecting a data type. For example:
      a = load 'input' as (a0:boolean, a1:tuple(a10:boolean, a11:int), a2);
      b = foreach a generate a0, a1, (boolean)a2;
      c = group b by a2; -- group by a boolean field

      When UTF8StorageConvert converts bytes into boolean, it expects "true" (ignore case) to be TRUE and "false" (ignore case) to be FALSE, otherwise, we get null. For example:
      a = load 'input' as (a0:boolean);

      input file:
      true -- we get TRUE
      True -- we get TRUE
      FALSE -- we get FALSE
      1 -- we get null

      We also change the interface LoadCaster/StoreCaster to include boolean type.
      Show
      Introduce boolean as first class Pig data type. You can use "boolean" anywhere Pig expecting a data type. For example: a = load 'input' as (a0:boolean, a1:tuple(a10:boolean, a11:int), a2); b = foreach a generate a0, a1, (boolean)a2; c = group b by a2; -- group by a boolean field When UTF8StorageConvert converts bytes into boolean, it expects "true" (ignore case) to be TRUE and "false" (ignore case) to be FALSE, otherwise, we get null. For example: a = load 'input' as (a0:boolean); input file: true -- we get TRUE True -- we get TRUE FALSE -- we get FALSE 1 -- we get null We also change the interface LoadCaster/StoreCaster to include boolean type.
    • Tags:
      boolean type pig

      Description

      Pig needs a Boolean data type. Pig-1097 is dependent on doing this.

      I volunteer. Is there anything beyond the work in src/org/apache/pig/data/ plus unit tests to make this work?

      This is a candidate project for Google summer of code 2011. More information about the program can be found at http://wiki.apache.org/pig/GSoc2011

        Attachments

        1. working_boolean.patch
          23 kB
          Russell Jurney
        2. PIG-1429_6.patch
          96 kB
          Daniel Dai
        3. PIG-1429_5.patch
          95 kB
          Zhijie Shen
        4. PIG-1429_4.patch
          122 kB
          Zhijie Shen
        5. PIG-1429_3.patch
          209 kB
          Zhijie Shen
        6. PIG-1429_2.patch
          39 kB
          Zhijie Shen
        7. PIG-1429_1.patch
          25 kB
          Zhijie Shen

          Issue Links

            Activity

              People

              • Assignee:
                zjshen Zhijie Shen
                Reporter:
                russell.jurney Russell Jurney
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 8h
                  8h
                  Remaining:
                  Remaining Estimate - 8h
                  8h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified