org.apache.hadoop.hive.ql.plan
Class ExprNodeDescUtils

java.lang.Object
  extended by org.apache.hadoop.hive.ql.plan.ExprNodeDescUtils

public class ExprNodeDescUtils
extends Object


Constructor Summary
ExprNodeDescUtils()
           
 
Method Summary
static ArrayList<ExprNodeDesc> backtrack(List<ExprNodeDesc> sources, Operator<?> current, Operator<?> terminal)
          Convert expressions in current operator to those in terminal operator, which is an ancestor of current or null (back to top operator).
static boolean containsPredicate(ExprNodeDesc source, ExprNodeDesc predicate)
          return true if predicate is already included in source
static Operator<?> getSingleParent(Operator<?> current, Operator<?> terminal)
           
static int indexOf(ExprNodeDesc origin, List<ExprNodeDesc> sources)
           
static boolean isDeterministic(ExprNodeDesc desc)
          Return false if the expression has any non determinitic function
static ExprNodeDesc mergePredicates(ExprNodeDesc prev, ExprNodeDesc next)
          bind two predicates by AND op
static ExprNodeDesc mergePredicates(List<ExprNodeDesc> exprs)
          bind n predicates by AND op
static String recommendInputName(ExprNodeDesc desc)
          Recommend name for the expression
static ExprNodeDesc replace(ExprNodeDesc origin, List<ExprNodeDesc> sources, List<ExprNodeDesc> targets)
           
static List<ExprNodeDesc> split(ExprNodeDesc current)
          split predicates by AND op
static List<ExprNodeDesc> split(ExprNodeDesc current, List<ExprNodeDesc> splitted)
          split predicates by AND op
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExprNodeDescUtils

public ExprNodeDescUtils()
Method Detail

indexOf

public static int indexOf(ExprNodeDesc origin,
                          List<ExprNodeDesc> sources)

replace

public static ExprNodeDesc replace(ExprNodeDesc origin,
                                   List<ExprNodeDesc> sources,
                                   List<ExprNodeDesc> targets)

containsPredicate

public static boolean containsPredicate(ExprNodeDesc source,
                                        ExprNodeDesc predicate)
return true if predicate is already included in source


mergePredicates

public static ExprNodeDesc mergePredicates(ExprNodeDesc prev,
                                           ExprNodeDesc next)
bind two predicates by AND op


mergePredicates

public static ExprNodeDesc mergePredicates(List<ExprNodeDesc> exprs)
bind n predicates by AND op


split

public static List<ExprNodeDesc> split(ExprNodeDesc current)
split predicates by AND op


split

public static List<ExprNodeDesc> split(ExprNodeDesc current,
                                       List<ExprNodeDesc> splitted)
split predicates by AND op


recommendInputName

public static String recommendInputName(ExprNodeDesc desc)
Recommend name for the expression


isDeterministic

public static boolean isDeterministic(ExprNodeDesc desc)
Return false if the expression has any non determinitic function


backtrack

public static ArrayList<ExprNodeDesc> backtrack(List<ExprNodeDesc> sources,
                                                Operator<?> current,
                                                Operator<?> terminal)
                                         throws SemanticException
Convert expressions in current operator to those in terminal operator, which is an ancestor of current or null (back to top operator).

Throws:
SemanticException

getSingleParent

public static Operator<?> getSingleParent(Operator<?> current,
                                          Operator<?> terminal)
                                   throws SemanticException
Throws:
SemanticException


Copyright © 2012 The Apache Software Foundation