hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yan Zhou" <y...@yahoo-inc.com>
Subject RE: Add "deepCopy" in LogicalExpression
Date Tue, 13 Jul 2010 16:06:25 GMT
What I used in logic expression simplification, where a DNF plan is
used, is a "logical expression proxy" that wraps up the original
expression in the original plan. But it is not translated to physical
plans, where I believe
extra care would be needed.


-----Original Message-----
From: Swati Jain [mailto:swati.j@aggiemail.usu.edu] 
Sent: Monday, July 12, 2010 11:20 PM
To: pig-dev@hadoop.apache.org
Subject: Add "deepCopy" in LogicalExpression


I am working on ticket PIG -1494 (
https://issues.apache.org/jira/browse/PIG-1494 ).

While implementing this functionality (conversion of logical expression
CNF), I need to construct the OperatorPlan for the base expressions of
CNF. For example, given an expression "(c1 < 10) AND (c3+b3 > 10)", the
form will result in expressions "(c1 < 10)" and "(c3+b3 > 10)". However,
each of these expressions would be referencing the original OperatorPlan
(that of expression "(c1 < 10) AND (c3+b3 > 10)" ) whereas they should
really be referencing their local OperatorPlan post CNF conversion.

To ensure correctness of the above approach, I am planning to add a
"deepCopy" method to LogicalExpression to create a copy of expressions.
my opinion, "deepCopy" will be a useful construct to have in general. It
would be used as follows:

LogicalExpressionPlan logPlan = new LogicalExpressionPlan();
LogicalExpression copyExpression = origExpression->deepcopy( logPlan );

Please provide feedback if any on the above approach.

Note that I considered writing a deepCopy visitor but found that
flawed because a valid plan is required for a visitor to work correctly,
in this case we need to construct that plan as we copy the expression.


View raw message