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

outputSchema modification from scripting UDFs

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9.2, 0.10.0
    • 0.11
    • None
    • None

    Description

      The examples for @schemaFunction that I've seen on the web (http://pig.apache.org/docs/r0.10.0/udf.html#decorators) tend to be trivial ones that return the same schema passed in. I had a problem where I wrote a python udf that added a new field into a tuple in a bag. I ended up not specifying schema in python and then casting in pig. How does the community feel about making it easier to generate a dynamic schema from a scripting UDF?

      This could be done by modifying JythonFunction.outputSchema to handle outputSchemaFunc returning a string like @outputSchema does, or by exposing a public api that makes it easier to manipulate org.apache.pig.impl.logicalLayer.schema.Schema

      Attachments

        1. PIG-2705.2.patch
          2 kB
          Josh Levy
        2. PIG-2705-1.patch
          2 kB
          Josh Levy

        Activity

          People

            Unassigned Unassigned
            levyjoshua Josh Levy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: