About

Edit photo

Monday, November 28, 2016

Aggregation functions in PIG


Example1: year price 2015 60 2014 45 2016 34 2014 75 2015 45 2014 41 I would like to get the result as, total price of the item by year. grunt> file = load '/tmp/yearprice.txt' using PigStorage(',') as (year:int,price:float); grunt> data = foreach file generate year, price by $0 > 1; grunt> group = group data by year; grunt> sum = foreach group generate group...

Wednesday, November 16, 2016

PIG left, right outer joins error


We know that, we can perform JOIN operation using pig, as well as left outer join, right outer join. sometimes you'll face error when working of left and right outer joins, but not to inner joins. that is because of schema. Even if there is no schema can perform inner...