Apache pig ERROR org.apache.pig.tools.grunt.grunt-ERROR 1000:解析过程中出错。标量只能与投影一起使用

Apache pig ERROR org.apache.pig.tools.grunt.grunt-ERROR 1000:解析过程中出错。标量只能与投影一起使用,apache-pig,Apache Pig,我的输入记录: 4000001,Kristina,Chung,55,Pilot 4000002,Paige,Chen,74,Teacher 4000003,Sherri,Melton,34,Firefighter 4000004,Gretchen,Hill,66,Computer hardware engineer 4000005,Karen,Puckett,74,Lawyer 4000006,Patrick,Song,42,Veterinarian 4000007,Elsie,Hamilton

我的输入记录:

4000001,Kristina,Chung,55,Pilot
4000002,Paige,Chen,74,Teacher
4000003,Sherri,Melton,34,Firefighter
4000004,Gretchen,Hill,66,Computer hardware engineer
4000005,Karen,Puckett,74,Lawyer
4000006,Patrick,Song,42,Veterinarian
4000007,Elsie,Hamilton,43,Pilot
4000008,Hazel,Bender,63,Carpenter
4000009,Malcolm,Wagner,39,Artist
4000010,Dolores,McLaughlin,60,Writer
4000011,Francis,McNamara,47,Therapist
4000012,Sandy,Raynor,26,Writer
4000013,Marion,Moon,41,Carpenter
4000014,Beth,Woodard,65,
4000015,Julia,Desai,49,Musician
4000016,Jerome,Wallace,52,Pharmacist
4000017,Neal,Lawrence,72,Computer support specialist
4000018,Jean,Griffin,45,Childcare worker
4000019,Kristine,Dougherty,63,Financial analyst
4000020,Crystal,Powers,67,Engineering technician
4000021,Alex,May,39,Environmental scientist
4000022,Eric,Steele,66,Doctor
4000023,Wesley,Teague,42,Carpenter
4000024,Franklin,Vick,28,Dancer
4000025,Claire,Gallagher,42,Musician
清管器命令:

cust = load '/input/custs' using PigStorage(',') as (custid:chararray, firstname:chararray, lastname:chararray,age:long,profession:chararray);
工作正常

groupbyprofession = group cust by profession;
countbyprofession = foreach groupbyprofession generate group, COUNT(cust);
dump countbyprofession;
工作正常

groupbyprofession = group cust by profession;
countbyprofession = foreach groupbyprofession generate group, COUNT(cust);
dump countbyprofession;
显示错误:
错误org.apache.pig.tools.grunt.grunt-错误1000:解析过程中出错。标量只能与投影一起使用。

我在脚本中没有看到任何问题,它看起来很好。我只是复制了你的输入和脚本,对我来说效果很好。你能再仔细检查一下吗?我重新启动了我的系统,它工作了,谢谢Sivasakthi