You can also try treating each relation as a whole string and do regex
replace, then you can split into fields.
On Mar 5, 2016 7:04 PM, "Parth Sawant" <[email protected]> wrote:

> That's what I'm doing as of now. I was looking for some way to run an
> iterative loop over the REPLACE.
>
> Thanks.
> On Mar 5, 2016 15:25, "Artem Ervits" <[email protected]> wrote:
>
> > You need to call replace on every field.
> > On Mar 5, 2016 4:01 PM, "Parth Sawant" <[email protected]> wrote:
> >
> > > Hi
> > > I'm trying to run Pig's REPLACE UDF over all the fields in every tuple
> > in a
> > > Pig relation.
> > > The REPLACE UDF does not however work with the * operator to run itself
> > > over the contents of each field in a tuple.
> > > For eg:
> > >
> > > SRC= LOAD 'input' using PigStorage('\\u001') as
> > > (col1:chararray,col2:chararray,col3:chararray,col4:chararray);
> > >
> > > REP=FOREACH SRC GENERATE REPLACE(col1,'str1','str2');
> > >
> > > I want to iterate this same replace function over all the columns in a
> > > tuple.
> > >
> > > Any help appreciated.
> > >
> > > Thanks
> > > Parth S
> > >
> >
>

Reply via email to