You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Gianmarco De Francisci Morales (JIRA)" <ji...@apache.org> on 2012/09/14 16:38:07 UTC
[jira] [Updated] (PIG-2879) Pig current releases lack a UDF
startsWith.This UDF tests if a given string starts with the specified
prefix.
[ 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