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

Add Boolean Data Type to Pig

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.7.0
    • 0.10.0
    • data
    • Reviewed
    • 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.
    • 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. PIG-1429_1.patch
          25 kB
          Zhijie Shen
        2. PIG-1429_2.patch
          39 kB
          Zhijie Shen
        3. PIG-1429_3.patch
          209 kB
          Zhijie Shen
        4. PIG-1429_4.patch
          122 kB
          Zhijie Shen
        5. PIG-1429_5.patch
          95 kB
          Zhijie Shen
        6. PIG-1429_6.patch
          96 kB
          Daniel Dai
        7. working_boolean.patch
          23 kB
          Russell Jurney

        Issue Links

          Activity

            People

              zjshen Zhijie Shen
              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