假设我有一个输入文件作为地图。
sample.txt
[1#"anything",2#"something",3#"anotherthing"]
[2#"kish"]
[3#"mad"]
[4#"sun"]
[1#"moon"]
[1#"world"]
由于没有指定键的值,我不想将其保存到文件中。是否有任何条件语句可以与 Store 关联?请帮我解决这个问题,以下是猪脚本。
A = LOAD 'sample.txt';
B = FOREACH A GENERATE $0#'5' AS temp;
C = FILTER B BY temp is not null;
-- It actually generates an empty part-r-X file
-- Is there any conditional statements i can include where if C is empty, Do not store ?
STORE C INTO '/user/logs/output';
谢谢 我在某个地方出错了吗?如果我错了,请纠正我。