1
我有一個包含一個文件max_rank.txt:豬拉丁 - 從不同袋中增加價值?
1,a
2,b
3,c
和第二個文件max_rank_add.txt:
d
e
f
我期待的結果是:
1,a
2,b
3,c,
4,d,
5,e
6,f
所以我要生成RANK
對於第二組值,但是從大於第一組的值開始。
腳本的Beginig大概是這樣的:
existing = LOAD 'max_rank.txt' using PigStorage(',') AS (id: int, text : chararray);
new = LOAD 'max_rank_add.txt' using PigStorage() AS (text2 : chararray);
ordered = ORDER existing by id desc;
limited = LIMIT ordered 1;
new_rank = RANK new;
但我有最後一個,最importatn線,即增加值從limited
到rank_new
從new_rank
問題。
你可以給點建議嗎?
問候 帕維爾