initialData = load 'Weather_Report.log' using PigStorage('|') as (cityid:int,cityname:chararray,currentWeather:chararray,weatherCode:int);
SPLIT initialData INTO noRainsCities IF weatherCode ==10;
STORE noRainCities INTO 'WEATHER_ANALYTICS/TEST_OUT/NoRainCititesData';

PLZ帮我出来
这是错误
2016-09-28 11:03:14,597 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: <line 2, column 52>  Syntax error, unexpected symbol at or near '='

最佳答案

iniData = LOAD 'empdetail.log' using PigStorage('|') as (id:int,x:chararray,city:chararray,tech:chararray);
split iniData into a if tech=='Java',b if city=='Pune';
dump a;
dump b;

伙计们:直到2个或更多的条件出现,拆分才有效;

问题解决了

关于hadoop - SPLIT命令在apache-pig中不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39754781/

10-12 22:49