|
|
-
UDF to check if String is Numeric or Integer
Prashant Kommireddi 2011-12-20, 19:39
Is there a UDF that could be used to check if a string is numeric (or an Integer). This would be nice to have (if we don't already) as part of Piggybank. A lot of other tools such as Splunk, AbInitio have this UDF built-in and I know companies are making an effort to move to Hadoop/Pig which could use this.
Use Case: In raw logs there are certain filters/conditions applied based on whether a particular field/value is numeric or not. For eg, SPLIT A INTO CATEGORY1 IF IsInt($0), CATEGORY2 IF !IsInt($0);
Thoughts?
-Prashant
-
Re: UDF to check if String is Numeric or Integer
Thejas Nair 2011-12-20, 21:53
Prashant, I can't find such an udf in piggybank. Yes, I think this is going to be useful for many users. I would be great if you can contribute such udfs to piggybank. Thanks, Thejas On 12/20/11 11:39 AM, Prashant Kommireddi wrote: > Is there a UDF that could be used to check if a string is numeric (or an > Integer). This would be nice to have (if we don't already) as part of > Piggybank. > A lot of other tools such as Splunk, AbInitio have this UDF built-in and I > know companies are making an effort to move to Hadoop/Pig which could use > this. > > Use Case: > In raw logs there are certain filters/conditions applied based on whether a > particular field/value is numeric or not. For eg, SPLIT A INTO CATEGORY1 IF > IsInt($0), CATEGORY2 IF !IsInt($0); > > Thoughts? > > -Prashant >
-
Re: UDF to check if String is Numeric or Integer
Prashant Kommireddi 2011-12-20, 22:00
Sure, will open Jira and work on this.
Thanks, Prashant
On Tue, Dec 20, 2011 at 1:53 PM, Thejas Nair <[EMAIL PROTECTED]> wrote:
> Prashant, > I can't find such an udf in piggybank. Yes, I think this is going to be > useful for many users. > I would be great if you can contribute such udfs to piggybank. > Thanks, > Thejas > > > > On 12/20/11 11:39 AM, Prashant Kommireddi wrote: > >> Is there a UDF that could be used to check if a string is numeric (or an >> Integer). This would be nice to have (if we don't already) as part of >> Piggybank. >> A lot of other tools such as Splunk, AbInitio have this UDF built-in and I >> know companies are making an effort to move to Hadoop/Pig which could use >> this. >> >> Use Case: >> In raw logs there are certain filters/conditions applied based on whether >> a >> particular field/value is numeric or not. For eg, SPLIT A INTO CATEGORY1 >> IF >> IsInt($0), CATEGORY2 IF !IsInt($0); >> >> Thoughts? >> >> -Prashant >> >> >
|
|
All projects made searchable here are trademarks of the Apache Software Foundation.
Service operated by
Sematext