Pig
  1. Pig
  2. PIG-1943

jython functions can use the @outputSchema decorator, but only if in the out script that is imported, we should add a builting module pigdecorators.py so that developers can import and use them in lib scripts

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.8.0, 0.9.0
    • Fix Version/s: None
    • Component/s: impl
    • Labels:

      Description

      if you have pig udf functions in a pig script, and want to re-use it (i.g. import from another script) the decorators must be defined. They will not be, due to scoping rules, so the decorators should be available via a standard importable module that ships with the jython framework (as we already define the decorators as part of initializing the interpreter).

      this simply involves adding an appropriately named: pigdecorators.py to the classpath, so a dev can do:

      from pigdecorators import *
      @outputSchema("w:chararray")
      def word():
      return 'word'

      this can be done currently in the primary script, but when https://issues.apache.org/jira/browse/PIG-1824 is completed, that script would not properly import when used within another script in the future.

        Activity

        Olga Natkovich made changes -
        Field Original Value New Value
        Fix Version/s 0.9.0 [ 12315191 ]
        Woody Anderson created issue -

          People

          • Assignee:
            Woody Anderson
            Reporter:
            Woody Anderson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development