Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> EvalFunc#outputSchema method not called in UDF


Copy link to this message
-
Re: EvalFunc#outputSchema method not called in UDF
Indeed, this is the case. outputSchema is only called when the job is being
created on the client side, not on the job side.

In the newer EvalFunc (not sure what version it was introduced in, but 7 is
quite old at this point), there is a public getInputSchema() method which
will return the input schema to the EvalFunc, and you can just call
outputSchema to get the outputSchema. So this exists :)
2012/8/15 Віталій Тим��ишин <[EMAIL PROTECTED]>

> As far as I could see, it's being called only on planning, not on
> execution. It's a pity and I've thought to open enhancement Jira ticket.
>
> Середа, 15 серпня 2012 р. користувач Zhang Jianfeng <[EMAIL PROTECTED]>
> написав:
> > Hello everyone,
> >
> >    I am coding one pig UDF function, like MyUDF:
> >
> >    public class MyUDF extends EvalFunc<Object>{
> >
> >        public Object exec(Tuple input) throws IOException()
> >        public Schema outputSchema(Schema input){}
> >    }
> >
> > But I found the outputSchema method never called in jobs.  I use the 0.7
> > pig. Does anyone know why this happens?
> >
> > Any thoughts will be appreciated.
> >
> > Thanks,
> > Jian Feng
> >
>
> --
> Best regards,
>  Vitalii Tymchyshyn
>