public class ExprNodeDescUtils extends Object
Constructor and Description |
---|
ExprNodeDescUtils() |
Modifier and Type | Method and Description |
---|---|
static ExprNodeDesc |
backtrack(ExprNodeDesc source,
Operator<?> current,
Operator<?> terminal) |
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 ArrayList<ExprNodeDesc> |
clone(List<ExprNodeDesc> sources) |
static boolean |
containsPredicate(ExprNodeDesc source,
ExprNodeDesc predicate)
return true if predicate is already included in source
|
static PrimitiveTypeInfo |
deriveMinArgumentCast(ExprNodeDesc childExpr,
TypeInfo targetType) |
static ExprNodeDesc[] |
extractComparePair(ExprNodeDesc expr1,
ExprNodeDesc expr2) |
static String[] |
extractFields(ExprNodeFieldDesc expr)
Extract fields from the given
node descriptor |
static ArrayList<ExprNodeDesc> |
genExprNodeDesc(Operator inputOp,
int startPos,
int endPos,
boolean addEmptyTabAlias,
boolean setColToNonVirtual)
Build ExprNodeColumnDesc for the projections in the input operator from
sartpos to endpos(both included).
|
static void |
getExprNodeColumnDesc(ExprNodeDesc exprDesc,
Map<Integer,ExprNodeDesc> hashCodeToColumnDescMap)
Get Map of ExprNodeColumnDesc HashCode to ExprNodeColumnDesc.
|
static void |
getExprNodeColumnDesc(List<ExprNodeDesc> exprDescList,
Map<Integer,ExprNodeDesc> hashCodeTocolumnDescMap) |
static Operator<?> |
getSingleParent(Operator<?> current,
Operator<?> terminal) |
static int |
indexOf(ExprNodeDesc origin,
List<ExprNodeDesc> sources) |
static boolean |
isAllConstants(List<ExprNodeDesc> value) |
static boolean |
isDeterministic(ExprNodeDesc desc)
Return false if the expression has any non deterministic function
|
static ExprNodeGenericFuncDesc |
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
|
public static int indexOf(ExprNodeDesc origin, List<ExprNodeDesc> sources)
public static ExprNodeDesc replace(ExprNodeDesc origin, List<ExprNodeDesc> sources, List<ExprNodeDesc> targets)
public static boolean containsPredicate(ExprNodeDesc source, ExprNodeDesc predicate)
public static ExprNodeGenericFuncDesc mergePredicates(ExprNodeDesc prev, ExprNodeDesc next)
public static ExprNodeDesc mergePredicates(List<ExprNodeDesc> exprs)
public static List<ExprNodeDesc> split(ExprNodeDesc current)
public static List<ExprNodeDesc> split(ExprNodeDesc current, List<ExprNodeDesc> splitted)
public static String recommendInputName(ExprNodeDesc desc)
public static boolean isDeterministic(ExprNodeDesc desc)
public static ArrayList<ExprNodeDesc> clone(List<ExprNodeDesc> sources)
public static ArrayList<ExprNodeDesc> backtrack(List<ExprNodeDesc> sources, Operator<?> current, Operator<?> terminal) throws SemanticException
SemanticException
public static ExprNodeDesc backtrack(ExprNodeDesc source, Operator<?> current, Operator<?> terminal) throws SemanticException
SemanticException
public static Operator<?> getSingleParent(Operator<?> current, Operator<?> terminal) throws SemanticException
SemanticException
public static ExprNodeDesc[] extractComparePair(ExprNodeDesc expr1, ExprNodeDesc expr2)
public static String[] extractFields(ExprNodeFieldDesc expr)
node descriptor
public static void getExprNodeColumnDesc(List<ExprNodeDesc> exprDescList, Map<Integer,ExprNodeDesc> hashCodeTocolumnDescMap)
public static void getExprNodeColumnDesc(ExprNodeDesc exprDesc, Map<Integer,ExprNodeDesc> hashCodeToColumnDescMap)
exprDesc
- hashCodeToColumnDescMap
- Assumption: If two ExprNodeColumnDesc have same hash code then
they are logically referring to same projectionpublic static boolean isAllConstants(List<ExprNodeDesc> value)
public static PrimitiveTypeInfo deriveMinArgumentCast(ExprNodeDesc childExpr, TypeInfo targetType)
public static ArrayList<ExprNodeDesc> genExprNodeDesc(Operator inputOp, int startPos, int endPos, boolean addEmptyTabAlias, boolean setColToNonVirtual)
inputOp
- Input Hive OperatorstartPos
- starting position in the input operator schema; must be >=0 and <=
endPosendPos
- end position in the input operator schema; must be >=0.Copyright © 2017 The Apache Software Foundation. All rights reserved.