我有一个csv文件,其中有两个变量。我得加上这两个variables:- like 工资和奖金(工资是逗号分隔的),但这在Pig身上是不会发生的。我也试过使用铸造。下面是该网站的截图dataset:-
我用了下面的Pigscript:-
register /home/ravimishra/piggybank-0.15.0.jar;
define CSVLoader org.apache.pig.piggybank.storage.CSVLoader();
emp_details_header = LOAD 'data/employee.csv' USING CSVLoader AS (id: int, name: chararray, address: chararray, occupation: chararray,salary: chararray,bonus: double);
ranked = rank emp_details_header;
NoHeader = Filter ranked by (rank_emp_details_header > 1);
B = FOREACH NoHeader GENERATE id,name,address,occupation, (double)salary + bonus as total ;
暂无答案!
目前还没有任何答案,快来回答吧!