Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Pig >> mail # user >> COALESCE UDF?


+
Something Something 2013-09-04, 05:50
+
Ruslan Al-Fakikh 2013-09-04, 11:30
+
Something Something 2013-09-04, 15:50
+
Sajid Raza 2013-09-04, 16:04
Copy link to this message
-
Re: COALESCE UDF?
Use simple jython UDF. Its 3 lines of code
04.09.2013 18:04 пользователь "Sajid Raza" <[EMAIL PROTECTED]> написал:

> For my two cents' worth I agree, it's nicer to have coalesce than the
> conditional operator.
>
> On Sep 4, 2013, at 8:50 AM, Something Something <[EMAIL PROTECTED]>
> wrote:
>
> > What if you've 10 fields?
> >
> >
> > On Wed, Sep 4, 2013 at 4:30 AM, Ruslan Al-Fakikh <[EMAIL PROTECTED]
> >wrote:
> >
> >> Hi,
> >>
> >> I think you could mimic it with an expression like this:
> >> b = foreach a generate ((field1 is null) ? ((field2 is null) ? null :
> >> field2) : field1);
> >>
> >> Hope that helps,
> >> Ruslan
> >>
> >>
> >> On Wed, Sep 4, 2013 at 9:50 AM, Something Something <
> >> [EMAIL PROTECTED]> wrote:
> >>
> >>> Is there a UDF in Piggybank (or somewhere) that will mimic
> functionality
> >> of
> >>> the COALESCE function in MySQL:
> >>
> http://www.w3resource.com/mysql/comparision-functions-and-operators/coalesce-function.php
> >>>
> >>> I know it will be very (very) easy to write this, but just don't want
> to
> >>> create one if one already exists.  I looked but couldn't find one.
> >>>
> >>> Please let me know.  Thanks.
> >>
>
+
Something Something 2013-09-04, 16:40
+
Russell Jurney 2013-09-04, 17:01
+
Serega Sheypak 2013-09-04, 19:00
+
John Meagher 2013-09-04, 17:00
+
Russell Jurney 2013-09-04, 16:32
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB