public class HiveCalciteUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HiveCalciteUtil.ConstantFinder
Walks over an expression and determines whether it is constant.
|
static class |
HiveCalciteUtil.JoinLeafPredicateInfo
JoinLeafPredicateInfo represents leaf predicate in Join condition
(conjuctive lement).
|
static class |
HiveCalciteUtil.JoinPredicateInfo
JoinPredicateInfo represents Join condition; JoinPredicate Info uses
JoinLeafPredicateInfo to represent individual conjunctive elements in the
predicate.
JoinPredicateInfo = JoinLeafPredicateInfo1 and JoinLeafPredicateInfo2... |
Constructor and Description |
---|
HiveCalciteUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> com.google.common.collect.ImmutableMap<Integer,T> |
getColInfoMap(List<T> hiveCols,
int startIndx) |
static com.google.common.collect.ImmutableMap<String,Integer> |
getColNameIndxMap(List<FieldSchema> tableFields) |
static ExprNodeDesc |
getExprNode(Integer inputRefIndx,
org.apache.calcite.rel.RelNode inputRel,
ExprNodeConverter exprConv) |
static List<ExprNodeDesc> |
getExprNodes(List<Integer> inputRefs,
org.apache.calcite.rel.RelNode inputRel,
String inputTabAlias) |
static List<String> |
getFieldNames(List<Integer> inputRefs,
org.apache.calcite.rel.RelNode inputRel) |
static com.google.common.collect.ImmutableList<org.apache.calcite.rex.RexNode> |
getInputRef(List<Integer> inputRefs,
org.apache.calcite.rel.RelNode inputRel) |
static Set<Integer> |
getInputRefs(org.apache.calcite.rex.RexNode expr) |
static List<org.apache.calcite.rex.RexNode> |
getProjsFromBelowAsInputRef(org.apache.calcite.rel.RelNode rel) |
static com.google.common.collect.ImmutableMap<String,Integer> |
getRowColNameIndxMap(List<org.apache.calcite.rel.type.RelDataTypeField> rowFields) |
static org.apache.calcite.util.Pair<org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode> |
getTopLevelSelect(org.apache.calcite.rel.RelNode rootRel)
Get top level select starting from root.
|
static com.google.common.collect.ImmutableMap<Integer,VirtualColumn> |
getVColsMap(List<VirtualColumn> hiveVCols,
int startIndx) |
static List<Integer> |
getVirtualCols(List<? extends org.apache.calcite.rex.RexNode> exps)
Get list of virtual columns from the given list of projections.
|
static boolean |
isDeterministic(org.apache.calcite.rex.RexNode expr) |
static boolean |
limitRelNode(org.apache.calcite.rel.RelNode rel) |
static boolean |
orderRelNode(org.apache.calcite.rel.RelNode rel) |
static org.apache.calcite.rex.RexNode |
projectNonColumnEquiConditions(org.apache.calcite.rel.core.RelFactories.ProjectFactory factory,
org.apache.calcite.rel.RelNode[] inputRels,
List<org.apache.calcite.rex.RexNode> leftJoinKeys,
List<org.apache.calcite.rex.RexNode> rightJoinKeys,
int systemColCount,
List<Integer> leftKeys,
List<Integer> rightKeys)
Push any equi join conditions that are not column references as Projections
on top of the children.
|
static com.google.common.collect.ImmutableSet<Integer> |
shiftVColsSet(Set<Integer> hiveVCols,
int shift) |
static List<Integer> |
translateBitSetToProjIndx(org.apache.calcite.util.ImmutableBitSet projBitSet) |
static boolean |
validateASTForUnsupportedTokens(ASTNode ast) |
public static List<Integer> getVirtualCols(List<? extends org.apache.calcite.rex.RexNode> exps)
exps
- list of rex nodes representing projectionspublic static boolean validateASTForUnsupportedTokens(ASTNode ast)
public static List<org.apache.calcite.rex.RexNode> getProjsFromBelowAsInputRef(org.apache.calcite.rel.RelNode rel)
public static List<Integer> translateBitSetToProjIndx(org.apache.calcite.util.ImmutableBitSet projBitSet)
public static org.apache.calcite.rex.RexNode projectNonColumnEquiConditions(org.apache.calcite.rel.core.RelFactories.ProjectFactory factory, org.apache.calcite.rel.RelNode[] inputRels, List<org.apache.calcite.rex.RexNode> leftJoinKeys, List<org.apache.calcite.rex.RexNode> rightJoinKeys, int systemColCount, List<Integer> leftKeys, List<Integer> rightKeys)
factory
- Project factory to use.inputRels
- inputs to a joinleftJoinKeys
- expressions for LHS of join keyrightJoinKeys
- expressions for RHS of join keysystemColCount
- number of system columns, usually zero. These columns are
projected at the leading edge of the output row.leftKeys
- on return this contains the join key positions from the new
project rel on the LHS.rightKeys
- on return this contains the join key positions from the new
project rel on the RHS.public static boolean limitRelNode(org.apache.calcite.rel.RelNode rel)
public static boolean orderRelNode(org.apache.calcite.rel.RelNode rel)
public static org.apache.calcite.util.Pair<org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode> getTopLevelSelect(org.apache.calcite.rel.RelNode rootRel)
rootRel
- public static boolean isDeterministic(org.apache.calcite.rex.RexNode expr)
public static <T> com.google.common.collect.ImmutableMap<Integer,T> getColInfoMap(List<T> hiveCols, int startIndx)
public static com.google.common.collect.ImmutableSet<Integer> shiftVColsSet(Set<Integer> hiveVCols, int shift)
public static com.google.common.collect.ImmutableMap<Integer,VirtualColumn> getVColsMap(List<VirtualColumn> hiveVCols, int startIndx)
public static com.google.common.collect.ImmutableMap<String,Integer> getColNameIndxMap(List<FieldSchema> tableFields)
public static com.google.common.collect.ImmutableMap<String,Integer> getRowColNameIndxMap(List<org.apache.calcite.rel.type.RelDataTypeField> rowFields)
public static com.google.common.collect.ImmutableList<org.apache.calcite.rex.RexNode> getInputRef(List<Integer> inputRefs, org.apache.calcite.rel.RelNode inputRel)
public static ExprNodeDesc getExprNode(Integer inputRefIndx, org.apache.calcite.rel.RelNode inputRel, ExprNodeConverter exprConv)
public static List<ExprNodeDesc> getExprNodes(List<Integer> inputRefs, org.apache.calcite.rel.RelNode inputRel, String inputTabAlias)
public static List<String> getFieldNames(List<Integer> inputRefs, org.apache.calcite.rel.RelNode inputRel)
Copyright © 2017 The Apache Software Foundation. All rights reserved.