为什么我不能在pig拉丁语中正确使用消歧运算符

62lalag4  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(346)
grunt> describe aa
aa: {header: int}
grunt> aa = FOREACH aa GENERATE aa::header as h2; 
2015-08-18 00:09:56,405 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1025: 
<line 7, column 25> Invalid field projection. Projected field [aa::header] does not exist in schema: header:int.
Details at logfile: /export/home/capsrch/pig_1439855906404.log
grunt> aa = FOREACH aa GENERATE header as h2;    
grunt> describe aa;
aa: {h2: int}

我的问题是你为什么这么做 FOREACH aa GENERATE aa::header as h2; 第3行失败。我不是在用电脑吗 :: 接线员在那里?

a8jjtwal

a8jjtwal1#

裁判:http://pig.apache.org/docs/r0.12.0/basic.html#disambiguate
从以上链接摘录:

Use the disambiguate operator ( :: ) to identify field names after JOIN, COGROUP, CROSS, or FLATTEN operators.

“aa”别名是否派生自以下运算符之一:join、cogroup、cross或flatten?如果没有,那么就不需要使用消歧运算符来解决歧义。

相关问题