org.apache.pig.newplan.logical.relational
Class LogicalPlan

java.lang.Object
  extended by org.apache.pig.newplan.BaseOperatorPlan
      extended by org.apache.pig.newplan.logical.relational.LogicalPlan
All Implemented Interfaces:
OperatorPlan

public class LogicalPlan
extends BaseOperatorPlan

LogicalPlan is the logical view of relational operations Pig will execute for a given script. Note that it contains only relational operations. All expressions will be contained in LogicalExpressionPlans inside each relational operator.


Field Summary
 
Fields inherited from class org.apache.pig.newplan.BaseOperatorPlan
fromEdges, log, ops, softFromEdges, softToEdges, toEdges
 
Constructor Summary
LogicalPlan()
           
 
Method Summary
 void explain(PrintStream ps, String format, boolean verbose)
           
 boolean isEqual(OperatorPlan other)
          Equality is checked by calling equals on every leaf in the plan.
 
Methods inherited from class org.apache.pig.newplan.BaseOperatorPlan
add, connect, connect, createSoftLink, disconnect, getOperators, getPredecessors, getSinks, getSoftLinkPredecessors, getSoftLinkSuccessors, getSources, getSuccessors, insertBetween, isEqual, remove, removeAndReconnect, removeSoftLink, replace, size, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogicalPlan

public LogicalPlan()
Method Detail

isEqual

public boolean isEqual(OperatorPlan other)
                throws FrontendException
Equality is checked by calling equals on every leaf in the plan. This assumes that plans are always connected graphs. It is somewhat inefficient since every leaf will test equality all the way to every root. But it is only intended for use in testing, so that should be ok. Checking predecessors (as opposed to successors) was chosen because splits (which have multiple successors) do not depend on order of outputs for correctness, whereas joins (with multiple predecessors) do. That is, reversing the outputs of split in the graph has no correctness implications, whereas reversing the inputs of join can. This method of doing equals will detect predecessors in different orders but not successors in different orders.

Specified by:
isEqual in interface OperatorPlan
Overrides:
isEqual in class BaseOperatorPlan
Parameters:
other - object to compare
Returns:
boolean if both the plans are equivalent
Throws:
FrontendException

explain

public void explain(PrintStream ps,
                    String format,
                    boolean verbose)
             throws FrontendException
Overrides:
explain in class BaseOperatorPlan
Throws:
FrontendException


Copyright © ${year} The Apache Software Foundation