[
https://issues.apache.org/jira/browse/PIG-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Dai updated PIG-2596:
----------------------------
Resolution: Fixed
Fix Version/s: 0.11
Assignee: Aniket Mokashi
Hadoop Flags: Reviewed
Status: Resolved (was: Patch Available)
Committed to trunk. Thanks Aniket!
> Jython UDF does not handle boolean output
> -----------------------------------------
>
> Key: PIG-2596
> URL: https://issues.apache.org/jira/browse/PIG-2596
> Project: Pig
> Issue Type: Bug
> Reporter: Daniel Dai
> Assignee: Aniket Mokashi
> Fix For: 0.11
>
> Attachments: PIG-2596-2.patch, PIG-2596.patch
>
>
> When a Jython UDF returns boolean, we still get integer object in Pig,
> through describe show the right boolean type.
> Jython UDF:
> {code}
> @outputSchema("retired:boolean")
> def isretired(age):
> if age == None:
> return None
> elif age>=60:
> return True
> else:
> return False
> {code}
> Pig script:
> {code}
> register 'scriptingudf.py' using jython as myfuncs;
> a = load 'student.txt' as (name:chararray, age:int, gpa:double);
> b = foreach a generate name, myfuncs.isretired(age);
> describe b;
> dump b;
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira