You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Olga Natkovich (JIRA)" <ji...@apache.org> on 2011/05/03 21:35:03 UTC
[jira] [Updated] (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
[ https://issues.apache.org/jira/browse/PIG-1943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olga Natkovich updated PIG-1943:
--------------------------------
Fix Version/s: (was: 0.9.0)
> 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
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-1943
> URL: https://issues.apache.org/jira/browse/PIG-1943
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Affects Versions: 0.8.0, 0.9.0
> Reporter: Woody Anderson
> Assignee: Woody Anderson
> Priority: Minor
> Labels: pig, python, schema, udf
>
> 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:
> {quote}
> from pigdecorators import *
> @outputSchema("w:chararray")
> def word():
> return 'word'
> {quote}
> 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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira