pig FILTER ERROR 1000:解析期间出错。遇到

时间:2018-10-22 15:52:53

标签: hadoop apache-pig hortonworks-sandbox

此脚本运行正常

data1 = LOAD '/user/maria_dev/ml-100k/test/u3.data' AS (usesrID:int, movieID:int, rating:int, ratingTime:int);
DUMP data1;

,输出为 enter image description here

当我使用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;

错误截图 enter image description here 错误详细信息:

  

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;

1 个答案:

答案 0 :(得分:1)

filterRowData1 = filter data1 by movieID == 556;

您应该在别名和查询之间使用空格。