You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Daniel Dai (Created) (JIRA)" <ji...@apache.org> on 2012/03/16 00:40:38 UTC

[jira] [Created] (PIG-2596) Jython UDF does not handle boolean output

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


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

        

[jira] [Updated] (PIG-2596) Jython UDF does not handle boolean output

Posted by "Aniket Mokashi (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aniket Mokashi updated PIG-2596:
--------------------------------

    Status: Patch Available  (was: Open)
    
> 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
>         Attachments: 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

        

[jira] [Updated] (PIG-2596) Jython UDF does not handle boolean output

Posted by "Daniel Dai (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Dai updated PIG-2596:
----------------------------

    Attachment: PIG-2596-2.patch

Looks good, enable ignored test fixed by the patch.
                
> 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
>         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

        

[jira] [Updated] (PIG-2596) Jython UDF does not handle boolean output

Posted by "Aniket Mokashi (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aniket Mokashi updated PIG-2596:
--------------------------------

    Attachment: PIG-2596.patch
    
> 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
>         Attachments: 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

        

[jira] [Updated] (PIG-2596) Jython UDF does not handle boolean output

Posted by "Daniel Dai (JIRA)" <ji...@apache.org>.
     [ 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