此脚本运行正常
data1 = LOAD '/user/maria_dev/ml-100k/test/u3.data' AS (usesrID:int, movieID:int, rating:int, ratingTime:int);
DUMP data1;
当我使用FILTER时,PIG会出错
data1 = LOAD '/user/maria_dev/ml-100k/test/u3.data' AS (usesrID:int, movieID:int, rating:int, ratingTime:int);
filterRowData1=filter data1 by (int)movieID == 556;
DUMP filterRowData1;
2018-10-20 23:20:24,653 [main]错误org.apache.pig.tools.grunt.Grunt -错误1000:解析期间发生错误。在第2行第1列遇到““ filterRowData1 = filter””。
我也尝试过
data1 = LOAD '/user/maria_dev/ml-100k/test/u3.data' AS (usesrID:int, movieID:int, rating:int, ratingTime:int);
filterRowData1=filter data1 by movieID == 556; (i have tried: '556'; but no luck)
DUMP filterRowData1;
答案 0 :(得分:1)
filterRowData1 = filter data1 by movieID == 556;
您应该在别名和查询之间使用空格。