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 >> NVL


I'd like to write a java UDF that functions more or less the same as a SQL
NVL command.  I've been stymied on writing a general function by the fact
that I want it to work on all data types--in particular chararrays and
numeric types.  If I extend EvalFunc<Object> then even if what I return is
a Double, Pig can't use it in a subsequent numeric calculation.

Any suggestions?  Has someone already written this UDF?

Thanks,
Cat
+
Ramakrishna Nalam 2013-05-08, 14:55
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