0
相同的鍵我有一個用例如何在列表中不同的值存儲使用豬
col1|col2
a101|10
a101|20
a101|10
a101|30
a201|40
a201|50
預期輸出:
A101 |列表< 10,20,30>
a201 |列表< 40,50>
下面是查詢,但我沒有得到預期的輸出。我想在列表中存儲col2不同的值。
input1= load 'list1.csv' using PigStorage('|') as (col1: chararray, col2: int);
input2 = DISTINCT (FOREACH input1 generate col1,col2);
input3 = GROUP input2 by col1;
dump input3;
(a101,{(a101,30),(a101,20),(a101,10)})
(a201,{(a201,50),(a201,40)})
它曾與上述變化 – a123