A = LOAD '/user/data/split.txt' as line:chararray;
B1 = filter A by $0 matches '1.*';
B2 = filter A by $0 matches '2.*';
or
SPLIT A INTO B1 IF ($0 matches '1.*'), B2 IF ($0 matches '2.*');
A = LOAD '/user/data/split.txt' as line:chararray;
B = FOREACH A GENERATE Flatten(TOKENIZE(line,' ')) ;
B1 = filter B by $0 matches '1.*';
B2 = filter B by $0 matches '2.*';
DUMP B1
DUMP B2
or
SPLIT B INTO B1 IF ($0 matches '1.*'), B2 IF ($0 matches '2.*');
2条答案
按热度按时间piztneat1#
有了新的输入更新版本,下面是另一个解决方案
hwazgwia2#
这里有一个方法。。。