AnsweredAssumed Answered

Group Function-optimisation

Question asked by achile on May 12, 2013
Latest reply on May 13, 2013 by Ted Dunning
Hi,I'm working on Pig programming.
I got this set of data:

    year;temperature;quality
    1950 0 1
    1950 22 1
    1950 -11 1
    1949 111 1
    1949 78 1

when I apply the "group...by" command, I get this result:

    (1950 0 1,{(1950 0 1,,)})
    (1949 78 1,{(1949 78 1,,)})
    (1950 22 1,{(1950 22 1,,)})
    (1949 111 1,{(1949 111 1,,)})
    (1950 -11 1,{(1950 -11 1,,)})

Instead of this one:

    (1949,{(1949 111 1)(1949 78 1)})
    (1950,{(1950 0 1),(1950 22 1), (1950 -11 1)})

I use this syntax : grouped_records = group records by year;

Please, could you tell me if something gone wrong?
Thanks for your help.

Outcomes