Test Drive of PiggyBank

REGISTER /home/liuwensui/pig/lib/piggybank.jar;

DEFINE CSVLoader org.apache.pig.piggybank.storage.CSVLoader;

a = LOAD '/home/liuwensui/Downloads/2008.csv2' USING CSVLoader();

b = FOREACH a GENERATE $8 as x;

c = LIMIT b 4;

dump c;

/*
(WN)
(WN)
(WN)
(WN)
*/

DEFINE L org.apache.pig.piggybank.evaluation.string.LOWER;

DEFINE R org.apache.pig.piggybank.evaluation.string.REPLACE;

d = FOREACH c GENERATE x, L(x), R(x, 'WN', 'WW');

dump d;

/*
(WN,wn,WW)
(WN,wn,WW)
(WN,wn,WW)
(WN,wn,WW)
*/