2

我有一个如下所示的文件,其中字段由“?”分隔:

(01-01-2011-04:43:50?2521795691802591407?94.20.58.165?

当我使用

mac = load 'Activity_1295336_01-01-2011.log.gz'using PigStorage('?');

我仍然无法访问内部字段,例如mac$1.

4

1 回答 1

0

它在我身边按预期工作......

$> pig --version
Apache Pig version 0.9.2-cdh4.0.0 (rexported) 
compiled Jun 04 2012, 17:42:27

$> cat temp1
01-01-2011-04:43:50?2521795691802591407?94.20.58.165?

grunt> a = load '/temp1' using PigStorage('?') as (datetime, id, ip); 
grunt> dump a;
grunt> >> (01-01-2011-04:43:50,2521795691802591407,94.20.58.165,)
grunt> b = foreach a { funky = CONCAT(ip, '_-* FUNKY'); generate datetime, id, funky;}
grunt> dump b;
grunt> >> (01-01-2011-04:43:50,2521795691802591407,94.20.58.165_-* FUNKY)
于 2012-10-05T04:58:40.987 回答