Don't know if it's available through PIG, but I do it with custom Java UDF (ie 
Java's String.replace with params).



Sincerely,
Marek M.
________________________________________
From: Marco Cadetg [[email protected]]
Sent: Tuesday, October 11, 2011 10:51 AM
To: [email protected]
Subject: replace value of a given field

Hi there,

I would like to replace the value of a field based on its value. E.g.:

A = LOAD 'student' USING PigStorage() AS (name:chararray);
DUMP A;
(John)
(Mary
(Bill)
(Joe)
(John)

Now I would like to replace all John's with Marco. Is there a way to do this
in PIG? I thought about using sth like SPLIT IF John and then union the
result again. Is there a better way?

Cheers
-Marco

Reply via email to