[
https://issues.apache.org/jira/browse/PIG-3290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13639966#comment-13639966
]
Cheolsoo Park commented on PIG-3290:
------------------------------------
Thanks for fixing it, Daniel! Overall looks good to me.
Have a minor question regarding the following code:
{code}
if (subAlias==null) {
subAlias = "";
}
alias = alias + "_" + subAlias;
{code}
Is it ever possible for subAlias to be null in the dereference expression? I
actually tried something like the following:
{code}
a = load '1.txt';
b = group a by ($0, $1);
c = foreach b generate group.$0, group.$1, COUNT(a.gpa);
{code}
But this gives me a NPE before I hit these lines of code. So I suppose subAlias
doesn't need to be checked whether it's null.
However, if there is a case where subAlias is null, won't your code cause an
alias conflict because multiple columns will be named as "alias_"?
So my questions is:
* Can we get rid of these lines of code at all?
* If not, shouldn't we append something unique per column when subAlias is null?
Please correct me if I am wrong.
> TestLogicalPlanBuilder.testQuery85 fail in trunk
> ------------------------------------------------
>
> Key: PIG-3290
> URL: https://issues.apache.org/jira/browse/PIG-3290
> Project: Pig
> Issue Type: Bug
> Affects Versions: 0.11.2
> Reporter: Johnny Zhang
> Assignee: Daniel Dai
> Attachments: PIG-3290-1.patch
>
>
> I can reproduce it locally as well, the exception is
> {noformat}
> junit.framework.AssertionFailedError:
> org.apache.pig.impl.plan.PlanValidationException: ERROR 1108:
> <line 1, column 79> Duplicate schema alias: group
> at
> org.apache.pig.test.TestLogicalPlanBuilder.buildPlan(TestLogicalPlanBuilder.java:2211)
> at
> org.apache.pig.test.TestLogicalPlanBuilder.testQuery85(TestLogicalPlanBuilder.java:1011)
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira