You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Anuroopa George (JIRA)" <ji...@apache.org> on 2012/08/16 07:45:37 UTC

[jira] [Created] (PIG-2879) Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.

Anuroopa George created PIG-2879:
------------------------------------

             Summary: Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix. 
                 Key: PIG-2879
                 URL: https://issues.apache.org/jira/browse/PIG-2879
             Project: Pig
          Issue Type: New Feature
          Components: piggybank
    Affects Versions: 0.10.0
            Reporter: Anuroopa George


Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.This UDF returns true if the character sequence represented by the string argument given as a prefix is a prefix of the character sequence represented by the given string; false otherwise.Also  true will be returned if the given prefix is an empty string or is equal to the given String.

--
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] [Commented] (PIG-2879) Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.

Posted by "Eli Reisman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464281#comment-13464281 ] 

Eli Reisman commented on PIG-2879:
----------------------------------

thanks again!

                
> Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix. 
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-2879
>                 URL: https://issues.apache.org/jira/browse/PIG-2879
>             Project: Pig
>          Issue Type: New Feature
>          Components: piggybank
>    Affects Versions: 0.10.0
>            Reporter: Anuroopa George
>            Assignee: Eli Reisman
>              Labels: features, patch
>             Fix For: 0.11
>
>         Attachments: PIG-2879-1.patch, PIG-2879-2.patch, PIG-2879-3.patch, PIG-2879-4.patch
>
>
> Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.This UDF returns true if the character sequence represented by the string argument given as a prefix is a prefix of the character sequence represented by the given string; false otherwise.Also  true will be returned if the given prefix is an empty string or is equal to the given String.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (PIG-2879) Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.

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

Gianmarco De Francisci Morales updated PIG-2879:
------------------------------------------------

    Assignee: Eli Reisman
      Status: Open  (was: Patch Available)

Hi Eli, thanks for the patch.

A few comments.
To properly handle the exception you should use warn.
{code}
    warn("Error message " + e.getMessage(), PigWarning.UDF_WARNING_1);
{code}

You should also override outputSchema.
{code}
    @Override
    public Schema outputSchema(Schema input) {
        return new Schema(new Schema.FieldSchema(null, DataType.BOOLEAN));
    }
{code}

You should check for null also "argument" and "testAgaints".

All the rest looks good.
I will commit once these issues have been addressed.
                
> Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix. 
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-2879
>                 URL: https://issues.apache.org/jira/browse/PIG-2879
>             Project: Pig
>          Issue Type: New Feature
>          Components: piggybank
>    Affects Versions: 0.10.0
>            Reporter: Anuroopa George
>            Assignee: Eli Reisman
>              Labels: features, patch
>         Attachments: PIG-2879-1.patch, PIG-2879-2.patch, PIG-2879-3.patch
>
>
> Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.This UDF returns true if the character sequence represented by the string argument given as a prefix is a prefix of the character sequence represented by the given string; false otherwise.Also  true will be returned if the given prefix is an empty string or is equal to the given String.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (PIG-2879) Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.

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

Eli Reisman updated PIG-2879:
-----------------------------

    Status: Patch Available  (was: Open)
    
> Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix. 
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-2879
>                 URL: https://issues.apache.org/jira/browse/PIG-2879
>             Project: Pig
>          Issue Type: New Feature
>          Components: piggybank
>    Affects Versions: 0.10.0
>            Reporter: Anuroopa George
>            Assignee: Eli Reisman
>              Labels: features, patch
>         Attachments: PIG-2879-1.patch, PIG-2879-2.patch, PIG-2879-3.patch
>
>
> Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.This UDF returns true if the character sequence represented by the string argument given as a prefix is a prefix of the character sequence represented by the given string; false otherwise.Also  true will be returned if the given prefix is an empty string or is equal to the given String.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIG-2879) Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.

Posted by "Anuroopa George (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13461619#comment-13461619 ] 

Anuroopa George commented on PIG-2879:
--------------------------------------

Thanks Eli
                
> Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix. 
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-2879
>                 URL: https://issues.apache.org/jira/browse/PIG-2879
>             Project: Pig
>          Issue Type: New Feature
>          Components: piggybank
>    Affects Versions: 0.10.0
>            Reporter: Anuroopa George
>            Assignee: Eli Reisman
>              Labels: features, patch
>             Fix For: 0.11
>
>         Attachments: PIG-2879-1.patch, PIG-2879-2.patch, PIG-2879-3.patch, PIG-2879-4.patch
>
>
> Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.This UDF returns true if the character sequence represented by the string argument given as a prefix is a prefix of the character sequence represented by the given string; false otherwise.Also  true will be returned if the given prefix is an empty string or is equal to the given String.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (PIG-2879) Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.

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

Eli Reisman updated PIG-2879:
-----------------------------

    Attachment: PIG-2879-4.patch

Is this on the right track? Thanks again

                
> Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix. 
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-2879
>                 URL: https://issues.apache.org/jira/browse/PIG-2879
>             Project: Pig
>          Issue Type: New Feature
>          Components: piggybank
>    Affects Versions: 0.10.0
>            Reporter: Anuroopa George
>            Assignee: Eli Reisman
>              Labels: features, patch
>         Attachments: PIG-2879-1.patch, PIG-2879-2.patch, PIG-2879-3.patch, PIG-2879-4.patch
>
>
> Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.This UDF returns true if the character sequence represented by the string argument given as a prefix is a prefix of the character sequence represented by the given string; false otherwise.Also  true will be returned if the given prefix is an empty string or is equal to the given String.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (PIG-2879) Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.

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

Gianmarco De Francisci Morales updated PIG-2879:
------------------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.11
     Release Note: Pig now includes a STARTSWITH built-in UDF that checks for presence of a given prefix in a chararray.
           Status: Resolved  (was: Patch Available)

+1
Committed to trunk.
Thanks Eli!
                
> Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix. 
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-2879
>                 URL: https://issues.apache.org/jira/browse/PIG-2879
>             Project: Pig
>          Issue Type: New Feature
>          Components: piggybank
>    Affects Versions: 0.10.0
>            Reporter: Anuroopa George
>            Assignee: Eli Reisman
>              Labels: features, patch
>             Fix For: 0.11
>
>         Attachments: PIG-2879-1.patch, PIG-2879-2.patch, PIG-2879-3.patch, PIG-2879-4.patch
>
>
> Pig current releases lack a UDF startsWith.This UDF tests if a given string starts with the specified prefix.This UDF returns true if the character sequence represented by the string argument given as a prefix is a prefix of the character sequence represented by the given string; false otherwise.Also  true will be returned if the given prefix is an empty string or is equal to the given String.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira