Pig
  1. Pig
  2. PIG-1420

Make CONCAT act on all fields of a tuple, instead of just the first two fields of a tuple

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.8.0
    • Component/s: impl
    • Labels:
    • Patch Info:
      Patch Available
    • Release Note:
      Hide
      CONCAT handles all fields in the supplied tuple, instead of just the first two. This is backwards compatible unless you were relying on it only using the first two fields, which seems unlikely. DataByteArray now has an append() method.

      Example use before:

      B = FOREACH A GENERATE CONCAT(CONCAT(first_name, ' '), last_name);

      Example extended use now:

      D = FOREACH C GENERATE CONCAT(first_name, ' ', last_name);
      Show
      CONCAT handles all fields in the supplied tuple, instead of just the first two. This is backwards compatible unless you were relying on it only using the first two fields, which seems unlikely. DataByteArray now has an append() method. Example use before: B = FOREACH A GENERATE CONCAT(CONCAT(first_name, ' '), last_name); Example extended use now: D = FOREACH C GENERATE CONCAT(first_name, ' ', last_name);
    • Tags:
      pig builtin concat all fields of a tuple

      Description

      org.apache.pig.builtin.CONCAT (which acts on DataByteArray's internally) and org.apache.pig.builtin.StringConcat (which acts on Strings internally), both act on the first two fields of a tuple. This results in ugly nested CONCAT calls like:

      CONCAT(CONCAT(A, ' '), B)

      The more desirable form is:

      CONCAT(A, ' ', B)

      This change will be backwards compatible, provided that no one was relying on the fact that CONCAT ignores fields after the first two in a tuple. This seems a reasonable assumption to make, or at least a small break in compatibility for a sizable improvement.

      1. PIG-1420.2.patch
        1 kB
        Dmitriy V. Ryaboy
      2. addconcat2.patch
        8 kB
        Russell Jurney

        Issue Links

          Activity

            People

            • Assignee:
              Russell Jurney
              Reporter:
              Russell Jurney
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

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

                  Development