I have the following input data table:
Product Price Country
A 5 Italy
B 4 USA
C 12 France
A 5 Italy
B 7 Russia
I'm doing summarize operation by 2 IDs (product and country). The code is following:
t3 = LOAD '/home/Desktop/3_table.data' USING PigStorage('\t') AS (product:chararray, price:int, country:chararray);
group_pr = GROUP t3 BY (product, country);
price_1 = FOREACH group_pr GENERATE CONCAT(group.product, group.country), SUM(t3.price);
STORE price_1 INTO 'sum_by_product_country' USING PigStorage('\t');
The output is:
AItaly 10
BUSA 4
BRussia 7
CFrance 12
The problem is, that I have to get the full table that contains as input data and output all together, so expecting output should be something like this:
A 5 Italy AItaly 10
B 4 USA BUSA 4
C 12 France CFrance 12
B 7 Russia BRussia 7
Maybe someone can help, how to get this output?