It will work if you change the foreach statement to
r1 = FOREACH records GENERATE LOWER(input_line);
Otherwise Pig thinks that your intent is to use relation (‘records’) as scalar (this is a new feature of 0.8).
On 1/18/11 10:36 PM, "김영우" wrote:
I found my mistakes. Your example works well with 'normal' relations(bag). but in my test code Pig did implicit casting from relations to scalars.
r1 = FOREACH records GENERATE LOWER(records.input_line);
STORE r1 INTO '$out';
I need to store 'r1' as a bag. How can I do this?
2011년 1월 19일 오전 3:55, Richard Ding <email@example.com>님의 말:
The method you’re looking for is PigStats.result(String alias) which returns a OutputStats object.
Here is an example:
R = Pig.compile(...).bind(...).runSingle()
iter = R.result(“G”).iterator()
????t = iter.next()
On 1/17/11 9:34 PM, "김영우" <firstname.lastname@example.org wrote:
I'm looking into embedding pig latin in a host language using pig trunk. so
far, basic features work fine for me. but I need to know how can I get
result tuples from the stored bag.
I need to apply some processing to each tuple from result bag. In wikihttp://wiki.apache.org/pig/TuringCompletePig
, It seems 'getResults()'
method works like what I want. but I got an error like "returned PigStats
has no attribute 'getResults()' ..."
Any advice would be appreciated.