public final class CorrelationUtilities extends Object
Constructor and Description |
---|
CorrelationUtilities() |
Modifier and Type | Method and Description |
---|---|
protected static <T extends Operator<?>> |
findParents(JoinOperator join,
Class<T> target) |
protected static <T extends Operator<?>> |
findPossibleParent(Operator<?> start,
Class<T> target,
boolean trustScript) |
protected static <T extends Operator<?>> |
findPossibleParents(Operator<?> start,
Class<T> target,
boolean trustScript) |
static List<Operator<? extends OperatorDesc>> |
findSiblingOperators(Operator<? extends OperatorDesc> op)
Find all sibling operators (which have the same child operator of op) of op (op
included).
|
static List<ReduceSinkOperator> |
findSiblingReduceSinkOperators(ReduceSinkOperator op)
Find all sibling ReduceSinkOperators (which have the same child operator of op) of op (op
included).
|
protected static Set<TableScanOperator> |
findTableScanOperators(Operator<?> startPoint)
Search the query plan tree from startPoint to the bottom.
|
protected static String |
getColumnName(Map<String,ExprNodeDesc> opColumnExprMap,
ExprNodeDesc expr) |
protected static Operator<?> |
getSingleChild(Operator<?> operator) |
protected static Operator<?> |
getSingleChild(Operator<?> operator,
boolean throwException) |
protected static <T> T |
getSingleChild(Operator<?> operator,
Class<T> type) |
protected static Operator<?> |
getSingleParent(Operator<?> operator) |
protected static Operator<?> |
getSingleParent(Operator<?> operator,
boolean throwException) |
protected static <T> T |
getSingleParent(Operator<?> operator,
Class<T> type) |
protected static boolean[] |
getSortedTags(JoinOperator joinOp) |
protected static Operator<?> |
getStartForGroupBy(ReduceSinkOperator cRS,
ReduceSinkDeDuplication.ReduceSinkDeduplicateProcCtx dedupCtx) |
protected static boolean |
hasGroupingSet(ReduceSinkOperator cRS) |
protected static int |
indexOf(ExprNodeDesc cexpr,
ExprNodeDesc[] pexprs,
Operator child,
Operator[] parents,
boolean[] sorted) |
protected static void |
insertOperatorBetween(Operator<?> newOperator,
Operator<?> parent,
Operator<?> child) |
protected static boolean |
isExisted(ExprNodeDesc expr,
List<ExprNodeDesc> columns) |
protected static void |
isNullOperator(Operator<?> operator)
Throws an exception if the input operator is null
|
protected static boolean |
isSortedTag(JoinOperator joinOp,
int tag) |
protected static void |
removeOperator(Operator<?> target,
Operator<?> child,
Operator<?> parent,
ParseContext context) |
static void |
removeOperator(Operator<?> target,
ParseContext context) |
protected static void |
removeReduceSinkForGroupBy(ReduceSinkOperator cRS,
GroupByOperator cGBYr,
ParseContext context,
org.apache.hadoop.hive.ql.optimizer.correlation.AbstractCorrelationProcCtx procCtx) |
protected static SelectOperator |
replaceReduceSinkWithSelectOperator(ReduceSinkOperator childRS,
ParseContext context,
org.apache.hadoop.hive.ql.optimizer.correlation.AbstractCorrelationProcCtx procCtx) |
protected static boolean isExisted(ExprNodeDesc expr, List<ExprNodeDesc> columns)
protected static String getColumnName(Map<String,ExprNodeDesc> opColumnExprMap, ExprNodeDesc expr)
protected static boolean hasGroupingSet(ReduceSinkOperator cRS) throws SemanticException
SemanticException
protected static Operator<?> getSingleParent(Operator<?> operator, boolean throwException) throws SemanticException
operator
- the input operatorthrowException
- if throw a exception when the input operator has multiple parentsHiveException
SemanticException
protected static Operator<?> getSingleParent(Operator<?> operator) throws SemanticException
SemanticException
protected static Operator<?> getSingleChild(Operator<?> operator, boolean throwException) throws SemanticException
operator
- the input operatorthrowException
- if throw a exception when the input operator has multiple childrenHiveException
SemanticException
protected static Operator<?> getSingleChild(Operator<?> operator) throws SemanticException
SemanticException
protected static <T> T getSingleChild(Operator<?> operator, Class<T> type) throws SemanticException
SemanticException
protected static <T> T getSingleParent(Operator<?> operator, Class<T> type) throws SemanticException
SemanticException
protected static Operator<?> getStartForGroupBy(ReduceSinkOperator cRS, ReduceSinkDeDuplication.ReduceSinkDeduplicateProcCtx dedupCtx) throws SemanticException
SemanticException
protected static boolean[] getSortedTags(JoinOperator joinOp)
protected static boolean isSortedTag(JoinOperator joinOp, int tag)
protected static int indexOf(ExprNodeDesc cexpr, ExprNodeDesc[] pexprs, Operator child, Operator[] parents, boolean[] sorted) throws SemanticException
SemanticException
protected static <T extends Operator<?>> T findPossibleParent(Operator<?> start, Class<T> target, boolean trustScript) throws SemanticException
SemanticException
protected static <T extends Operator<?>> T[] findPossibleParents(Operator<?> start, Class<T> target, boolean trustScript) throws SemanticException
SemanticException
protected static <T extends Operator<?>> T[] findParents(JoinOperator join, Class<T> target) throws SemanticException
SemanticException
protected static Set<TableScanOperator> findTableScanOperators(Operator<?> startPoint)
startPoint
- the operator which the search will start atpublic static List<ReduceSinkOperator> findSiblingReduceSinkOperators(ReduceSinkOperator op) throws SemanticException
SemanticException
public static List<Operator<? extends OperatorDesc>> findSiblingOperators(Operator<? extends OperatorDesc> op) throws SemanticException
SemanticException
protected static SelectOperator replaceReduceSinkWithSelectOperator(ReduceSinkOperator childRS, ParseContext context, org.apache.hadoop.hive.ql.optimizer.correlation.AbstractCorrelationProcCtx procCtx) throws SemanticException
SemanticException
protected static void removeReduceSinkForGroupBy(ReduceSinkOperator cRS, GroupByOperator cGBYr, ParseContext context, org.apache.hadoop.hive.ql.optimizer.correlation.AbstractCorrelationProcCtx procCtx) throws SemanticException
SemanticException
protected static void isNullOperator(Operator<?> operator) throws SemanticException
operator
- SemanticException
- if the input operator is nullprotected static void insertOperatorBetween(Operator<?> newOperator, Operator<?> parent, Operator<?> child) throws SemanticException
newOperator
- the operator will be inserted between child and parentchild
- parent
- context
- HiveException
SemanticException
public static void removeOperator(Operator<?> target, ParseContext context)
protected static void removeOperator(Operator<?> target, Operator<?> child, Operator<?> parent, ParseContext context)
Copyright © 2016 The Apache Software Foundation. All rights reserved.