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

Allow TOMAP to accept dynamically sized input

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.15.0
    • 0.16.0
    • None
    • None
    • Reviewed
    • The TOMAP function now also accepts a bag of key-value pairs as input.

    Description

      Currently the TOMAP function only supports a parameter list of values.
      Triggered by reading http://stackoverflow.com/q/17847970/

      I want to convert a bag of tuples to a map with specific value in each tuple as key. Basically I want to change:
      {(id1, value1),(id2, value2), ...} into [id1#value1, id2#value2]

      I propose to make the TOMAP accept both the current form

      TOMAP($0, $1, $2, $3)

      and a new form where the a single parameter:
      A bag of Tuples where each Tuple has exactly two fields: a "key" and a "value".

      Attachments

        1. PIG-4638-20150723.patch
          7 kB
          Niels Basjes
        2. PIG-4638-20150805-1058.patch
          7 kB
          Niels Basjes
        3. PIG-4638-20150805-1247.patch
          7 kB
          Niels Basjes

        Issue Links

          Activity

            People

              nielsbasjes Niels Basjes
              nielsbasjes Niels Basjes
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: