|
|
Sandesh Devaraju 2010-03-30, 20:52
Hi All,
Is there a way to get current InputSplit in a UDF (more specifically, a filter function)?
I have a filter function that validates input rows according to certain criteria and I would like to report the source of failures (if any).
Thanks in advance.
- Sandesh
Ashutosh Chauhan 2010-03-31, 03:36
Try:
PigSplit pigSplit ((PigSplit)((Context)PigMapReduce.sJobContext).getInputSplit()); InputSplit is = pigSplit.getWrappedSplit();
Ashutosh
On Tue, Mar 30, 2010 at 13:52, Sandesh Devaraju <[EMAIL PROTECTED]> wrote: > Hi All, > > Is there a way to get current InputSplit in a UDF (more specifically, > a filter function)? > > I have a filter function that validates input rows according to > certain criteria and I would like to report the source of failures (if > any). > > Thanks in advance. > > - Sandesh >
Mridul Muralidharan 2010-03-31, 06:24
You might want to be careful with this ... the udf could get used in both map & reduce side, no ?
Regards, Mridul
On Wednesday 31 March 2010 02:22 AM, Sandesh Devaraju wrote: > Hi All, > > Is there a way to get current InputSplit in a UDF (more specifically, > a filter function)? > > I have a filter function that validates input rows according to > certain criteria and I would like to report the source of failures (if > any). > > Thanks in advance. > > - Sandesh
Ashutosh Chauhan 2010-03-31, 15:04
Yes, this works only if udf is running in Map. From Sandesh's mail it does look like his udf will run in map. Also note that this is highly specific internal implementation detail of Pig, which may change in future.
Ashutosh On Tue, Mar 30, 2010 at 23:24, Mridul Muralidharan <[EMAIL PROTECTED]> wrote: > > You might want to be careful with this ... the udf could get used in both > map & reduce side, no ? > > Regards, > Mridul > > On Wednesday 31 March 2010 02:22 AM, Sandesh Devaraju wrote: >> >> Hi All, >> >> Is there a way to get current InputSplit in a UDF (more specifically, >> a filter function)? >> >> I have a filter function that validates input rows according to >> certain criteria and I would like to report the source of failures (if >> any). >> >> Thanks in advance. >> >> - Sandesh > >
|
|