[
https://issues.apache.org/jira/browse/PIG-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581490#action_12581490
]
Shravan Matthur Narayanamurthy commented on PIG-158:
----------------------------------------------------
@Santosh:
1) The way to solve the typing problem is to type your class and not the
function. So the Operator is typed with the type of visitor it uses. So
Operator<V extends PlanVisitor>. LogicalOperator<V extends LOVisitor> extends
Operator<LOVisitor>. This makes sure that you are extending a particular type
of the class and solves the problem of having different visit methods for your
entire class hierarchy.
5) What I meant to say was for ex. in LOGenerate, if I say generate Count(A) as
link_count, Count(B) as link_quality, will the schema reflect the aliases
link_* ? I was not sure because in many places when you create the new
FieldSchema, you use null for the alias.
@Alan & Santosh
Plan vs List of operators: The way I was trying to solve this in the physical
case was by having a separate ExprPlan which just consists of expression
operators. Associated with this will be an ExprPlanVisitor. So when Filter's
visit is called, we set the ExprPlanVisitor's plan to the filter's ExprPlan and
call its visit method which can do the traversal using one of the methods in
PlanVisitor. All ExpressionOperators would be extending PhysicalOperators typed
with ExprPlanVisitor and would use this visitXXX calls of this visitor instead
of the LOVisitor's visit methods. As a byproduct of this, both generate and
project will have to be considered ExpressionOperators. So to summarize:
ExpressionOperator extends PhysicalOperator<ExprPlanVisitor>
In LOVisitor/POVisitor visit methods,
visit(Filter f){ new ExprPlanVisitor(f.exprPlan).visit(); }
ExprPlanVisitor<ExpressionOperator, ExprPlan>{
//implicitly ExprPlan mPlan;
visitXXX(){ //do nothing }
visit(){ depthFirst();}
}
This would also need that the PlanVisitor is also typed with the Operator and
the Plan.
> Rework logical plan
> -------------------
>
> Key: PIG-158
> URL: https://issues.apache.org/jira/browse/PIG-158
> Project: Pig
> Issue Type: Sub-task
> Components: impl
> Reporter: Alan Gates
> Assignee: Alan Gates
> Attachments: logical_operators.patch
>
>
> Rework the logical plan in line with
> http://wiki.apache.org/pig/PigExecutionModel
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.