public class HiveRelOptUtil
extends org.apache.calcite.plan.RelOptUtil
| Modifier and Type | Class and Description |
|---|---|
static class |
HiveRelOptUtil.PKFKJoinInfo |
static class |
HiveRelOptUtil.RewritablePKFKJoinInfo |
org.apache.calcite.plan.RelOptUtil.Exists, org.apache.calcite.plan.RelOptUtil.InputFinder, org.apache.calcite.plan.RelOptUtil.InputReferencedVisitor, org.apache.calcite.plan.RelOptUtil.Logic, org.apache.calcite.plan.RelOptUtil.RexInputConverter, org.apache.calcite.plan.RelOptUtil.SubQueryType, org.apache.calcite.plan.RelOptUtil.TypeDumper, org.apache.calcite.plan.RelOptUtil.VariableUsedVisitor| Constructor and Description |
|---|
HiveRelOptUtil() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.calcite.rel.RelNode |
createProject(org.apache.calcite.tools.RelBuilder relBuilder,
org.apache.calcite.rel.RelNode child,
List<Integer> posList)
Creates a relational expression that projects the given fields of the
input.
|
static org.apache.calcite.rel.RelNode |
createSingleValueAggRel(org.apache.calcite.plan.RelOptCluster cluster,
org.apache.calcite.rel.RelNode rel,
org.apache.calcite.rel.core.RelFactories.AggregateFactory aggregateFactory)
Creates a LogicalAggregate that removes all duplicates from the result of
an underlying relational expression.
|
static HiveRelOptUtil.PKFKJoinInfo |
extractPKFKJoin(org.apache.calcite.rel.core.Join join,
List<org.apache.calcite.rex.RexNode> joinFilters,
boolean leftInputPotentialFK,
org.apache.calcite.rel.metadata.RelMetadataQuery mq)
Returns a triple where first value represents whether we could extract a FK-PK join
or not, the second value is a pair with the column from left and right input that
are used for the FK-PK join, and the third value are the predicates that are not
part of the FK-PK condition.
|
static org.apache.calcite.util.Pair<org.apache.calcite.plan.RelOptTable,List<Integer>> |
getColumnOriginSet(org.apache.calcite.rel.RelNode rel,
org.apache.calcite.util.ImmutableBitSet colSet) |
static List<Integer> |
getNewRelDistributionKeys(HiveProject project,
org.apache.calcite.rel.RelDistribution distribution)
Map Exchange distribution keys to the specified Project columns.
|
static List<org.apache.calcite.rel.RelFieldCollation> |
getNewRelFieldCollations(HiveProject project,
org.apache.calcite.rel.RelCollation sortCollation,
org.apache.calcite.plan.RelOptCluster cluster)
Map Sort and SortExchange keys to the specified Project columns.
|
static HiveRelOptUtil.RewritablePKFKJoinInfo |
isRewritablePKFKJoin(org.apache.calcite.rel.core.Join join,
org.apache.calcite.rel.RelNode fkInput,
org.apache.calcite.rel.RelNode nonFkInput,
org.apache.calcite.rel.metadata.RelMetadataQuery mq) |
static boolean |
isRowFilteringPlan(org.apache.calcite.rel.metadata.RelMetadataQuery mq,
org.apache.calcite.rel.RelNode operator)
Given a RelNode, it checks whether there is any filtering condition
below.
|
static org.apache.calcite.rex.RexNode |
splitCorrelatedFilterCondition(org.apache.calcite.rel.core.Filter filter,
List<org.apache.calcite.rex.RexNode> joinKeys,
List<org.apache.calcite.rex.RexNode> correlatedJoinKeys,
boolean extractCorrelatedFieldAccess) |
static org.apache.calcite.rex.RexNode |
splitHiveJoinCondition(List<org.apache.calcite.rel.type.RelDataTypeField> sysFieldList,
List<org.apache.calcite.rel.RelNode> inputs,
org.apache.calcite.rex.RexNode condition,
List<List<org.apache.calcite.rex.RexNode>> joinKeys,
List<Integer> filterNulls,
List<org.apache.calcite.sql.SqlOperator> rangeOp)
Splits out the equi-join (and optionally, a single non-equi) components
of a join condition, and returns what's left.
|
static String |
toJsonString(org.apache.calcite.rel.RelNode rel)
Converts a relational expression to a string, showing information that will aid
to parse the string back.
|
addTrait, adjustKeys, analyzeSimpleEquiJoin, andJoinFilters, areRowTypesEqual, checkProjAndChildInputs, classifyFilters, collapseExpandedIsNotDistinctFromExpr, conjunctions, contains, copyRelHints, copyRelHints, correlationColumns, countJoins, createCastRel, createCastRel, createDistinctRel, createDmlRowType, createEquiJoinCondition, createExistsPlan, createExistsPlan, createExistsPlan, createFilter, createFilter, createFilter, createFilter, createNullFilter, createProject, createProject, createProject, createProject, createProject, createProject, createProject, createProject, createProjectJoinRel, createRename, createRenameRel, createSingleValueAggRel, createSwappedJoinExprs, decomposeConjunction, decomposeConjunction, decomposeDisjunction, deduplicateColumns, disjunctions, dumpPlan, dumpPlan, dumpType, eq, equal, equalType, findAllTableQualifiedNames, findAllTables, findTables, getAllFields, getAllFields2, getColumnConstraints, getContext, getFieldTypeList, getVariablesSet, getVariablesSetAndUsed, getVariablesUsed, go, inferViewPredicates, isDistinctFrom, isEqui, isLimit, isOrder, isPureLimit, isPureOrder, notContainsCorrelation, notContainsWindowedAgg, notContainsWindowedAgg, notContainsWindowedAgg, op, permutation, permutationIgnoreCast, permutationPushDownProject, permute, permute, projectJoinInputs, projectMapping, projectMultiJoin, propagateRelHints, propagateRelHints, pushDownJoinConditions, pushDownJoinConditions, pushDownJoinConditions, pushFilterPastProject, pushPastProject, pushPastProject, pushPastProjectUnlessBloat, registerAbstractRelationalRules, registerAbstractRels, registerAbstractRules, registerDefaultRules, renameIfNecessary, replace, replaceInput, simplifyJoin, splitCorrelatedFilterCondition, splitCorrelatedFilterCondition, splitFilters, splitJoinCondition, splitJoinCondition, splitJoinCondition, splitJoinCondition, toString, toString, validateValueAgainstConstraint, verifyTypeEquivalencepublic static org.apache.calcite.rex.RexNode splitHiveJoinCondition(List<org.apache.calcite.rel.type.RelDataTypeField> sysFieldList, List<org.apache.calcite.rel.RelNode> inputs, org.apache.calcite.rex.RexNode condition, List<List<org.apache.calcite.rex.RexNode>> joinKeys, List<Integer> filterNulls, List<org.apache.calcite.sql.SqlOperator> rangeOp) throws CalciteSemanticException
sysFieldList - list of system fieldsinputs - join inputscondition - join conditionjoinKeys - The join keys from the inputs which are equi-join
keysfilterNulls - The join key positions for which null values will not
match. null values only match for the "is not distinct
from" condition.rangeOp - if null, only locate equi-joins; otherwise, locate a
single non-equi join predicate and return its operator
in this list; join keys associated with the non-equi
join predicate are at the end of the key lists
returnedCalciteSemanticExceptionpublic static org.apache.calcite.rel.RelNode createProject(org.apache.calcite.tools.RelBuilder relBuilder,
org.apache.calcite.rel.RelNode child,
List<Integer> posList)
Optimizes if the fields are the identity projection.
relBuilder - RelBuilderchild - Input relational expressionposList - Source of each projected fieldpublic static org.apache.calcite.rex.RexNode splitCorrelatedFilterCondition(org.apache.calcite.rel.core.Filter filter,
List<org.apache.calcite.rex.RexNode> joinKeys,
List<org.apache.calcite.rex.RexNode> correlatedJoinKeys,
boolean extractCorrelatedFieldAccess)
public static org.apache.calcite.rel.RelNode createSingleValueAggRel(org.apache.calcite.plan.RelOptCluster cluster,
org.apache.calcite.rel.RelNode rel,
org.apache.calcite.rel.core.RelFactories.AggregateFactory aggregateFactory)
rel - underlying relpublic static boolean isRowFilteringPlan(org.apache.calcite.rel.metadata.RelMetadataQuery mq,
org.apache.calcite.rel.RelNode operator)
public static HiveRelOptUtil.PKFKJoinInfo extractPKFKJoin(org.apache.calcite.rel.core.Join join, List<org.apache.calcite.rex.RexNode> joinFilters, boolean leftInputPotentialFK, org.apache.calcite.rel.metadata.RelMetadataQuery mq)
public static HiveRelOptUtil.RewritablePKFKJoinInfo isRewritablePKFKJoin(org.apache.calcite.rel.core.Join join, org.apache.calcite.rel.RelNode fkInput, org.apache.calcite.rel.RelNode nonFkInput, org.apache.calcite.rel.metadata.RelMetadataQuery mq)
public static org.apache.calcite.util.Pair<org.apache.calcite.plan.RelOptTable,List<Integer>> getColumnOriginSet(org.apache.calcite.rel.RelNode rel, org.apache.calcite.util.ImmutableBitSet colSet)
public static String toJsonString(org.apache.calcite.rel.RelNode rel)
public static List<org.apache.calcite.rel.RelFieldCollation> getNewRelFieldCollations(HiveProject project, org.apache.calcite.rel.RelCollation sortCollation, org.apache.calcite.plan.RelOptCluster cluster)
project - the ProjectsortCollation - current collation in Sortcluster - RelOptClusterpublic static List<Integer> getNewRelDistributionKeys(HiveProject project, org.apache.calcite.rel.RelDistribution distribution)
project - the Projectdistribution - current distribution in ExchangeCopyright © 2022 The Apache Software Foundation. All rights reserved.