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 Threaded View
Pig >> mail # user >> Many to One UDF Problem


Copy link to this message
-
Re: Many to One UDF Problem
I messed up, your original UDF does not need to be changed.

Just pass in all fields (*) as I suggested in my previous email, and access
them the way you were doing it before:
String query = (String)input.get(0);
String query1 = (String)input.get(1);

That should work.

-Prashant
On Wed, May 9, 2012 at 7:00 PM, DIPESH KUMAR SINGH <[EMAIL PROTECTED]>wrote:

> MapReduce job runs now, but string output of UDF is not coming. It shows
> something
> like this:
>
> (Jeff,13,)
> (John,12,)
>
> May be something needs to be changed in output schema, i was passing
> earlier:
>
> @Override
> public Schema outputSchema(Schema input) {
> return new Schema(new
> Schema.FieldSchema(getSchemaName(this.getClass().getName().toLowerCase(),
> input), DataType.CHARARRAY));
> }
>
> Thanks,
> Dipesh
>
> On Thu, May 10, 2012 at 7:09 AM, Prashant Kommireddi <[EMAIL PROTECTED]
> >wrote:
>
> > public List<FuncSpec> getArgToFuncMapping() throws FrontendException
> > needs to be modified accordingly, since you are now passing your UDF
> > the entire tuple. You don't really need to implement it if there is no
> > overloaded function.
> >
> > Sent from my iPhone
> >
> > On May 9, 2012, at 6:19 PM, DIPESH KUMAR SINGH <[EMAIL PROTECTED]>
> > wrote:
> >
> > > public List<FuncSpec> getArgToFuncMapping() throws FrontendException
> >
>
>
>
> --
> Dipesh Kr. Singh
>
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