我有數據文件拆分「|」所以我使用下面的代碼。豬羣添加
RAW_LOG = LOAD 'logs.log' USING TextLoader as (line:chararray);
splt = foreach RAW_LOG generate FLATTEN(STRSPLIT($0, '\\|'));
id_vals = foreach splt generate $4 as uid, $8 as site_id , $9 as dsid , $6 as amt;
我想sum(amt)每個site_id,我試過group by但沒有工作。
您是否想通過site_id進行分組並總結每個組的amt值? – mbaxi 2014-10-06 07:56:41