You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Shepherd Chu (Created) (JIRA)" <ji...@apache.org> on 2012/03/08 05:31:33 UTC
[jira] [Created] (PIG-2575) underline symbol is not supported in
foreach block
underline symbol is not supported in foreach block
--------------------------------------------------
Key: PIG-2575
URL: https://issues.apache.org/jira/browse/PIG-2575
Project: Pig
Issue Type: Bug
Environment: HadoopVersion PigVersion
0.20.2-cdh3u2 0.9.1
Reporter: Shepherd Chu
Before I found the bug, I used script like this:
grunt> results_from_bizlog = foreach log_group_by_accountid { region_modified_account = filter bizlog by optlevel ==3 and optcontent==2 and oldvalue!=newvalue and oldvalue is not null; generate group, ((COUNT(region_modified_account) >0) ? 1:0); }
then pig reports error:
2012-03-08 12:24:15,148 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: Pig script failed to parse:
<line 45, column 205> Invalid scalar projection: region_modified_account : A column needs to be projected from a relation for it to be used as a scalar
Details at logfile: /home/hadoop/pig-0.9.1/pig_1331107854401.log
After I changed the identifier "region_modified_account" to "regionmodifiedaccount", no error was reported.
grunt> results_from_bizlog = foreach log_group_by_accountid { regionmodifiedaccount = filter bizlog by optlevel ==3 and optcontent==2 and oldvalue!=newvalue and oldvalue is not null; generate group, ((COUNT(regionmodifiedaccount) >0) ? 1:0); }
2012-03-08 12:27:45,796 [main] WARN org.apache.pig.PigServer - Encountered Warning IMPLICIT_CAST_TO_LONG 9 time(s).
I think there must be some kind of bug of the underline symbol usage.
Am I right?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] [Created] (PIG-2575) underline symbol is not supported in
foreach block
Posted by Jonathan Coveney <jc...@gmail.com>.
Is region_modified_account used elsewhere? There is a known bug where
within a foreach block you can't make a relation that shares a name
externally.
2012/3/7 Dmitriy Ryaboy <dv...@gmail.com>
> More likely, its a variable name collision. Could you post the whole
> script?
>
>
Re: [jira] [Created] (PIG-2575) underline symbol is not supported in foreach block
Posted by Dmitriy Ryaboy <dv...@gmail.com>.
More likely, its a variable name collision. Could you post the whole script?