請參考:
http://glj8989332.blogspot.tw/2015/11/hadoop-pig-0150.html
step1 : put the file to server
hadoop fs -put Employee_Salaries_2014.csv hdfs://localhost:9000/salary/1.csv
failure:
Input(s):
Failed to read data from "hdfs://localhost:9000/salary/1.csv"
解法:salary刪掉
grunt> salarydata = LOAD 'hdfs://localhost:9000/1.csv' USING PigStorage(',') AS ( FullName1:chararray , FullName2:chararray ,Gender:chararray , CurrentAnnualSalary : chararray,GrossPayReceived2014 : chararray ,OvertimePay2014:chararray , Department:chararray , DepartmentName:chararray,Division:chararray, AssignmentCategory: chararray , PositionTitle:chararray, UnderfilledJobTitle: chararray,DateFirstHired:chararray);
DUMP salarydata
結果:

No comments:
Post a Comment