| Package | Description |
|---|---|
| org.apache.calcite.adapter.enumerable |
Query optimizer rules for Java calling convention.
|
| org.apache.calcite.adapter.jdbc |
Query provider based on a JDBC data source.
|
| org.apache.calcite.interpreter |
Provides an implementation of relational expressions using an interpreter.
|
| org.apache.calcite.plan |
Defines interfaces for constructing rule-based optimizers of
relational expressions.
|
| org.apache.calcite.rel |
Defines relational expressions.
|
| org.apache.calcite.rel.core |
Defines core relational expressions.
|
| org.apache.calcite.rel.logical |
Defines logical relational expressions.
|
| org.apache.calcite.rel.metadata |
Defines metadata interfaces and utilities for relational
expressions.
|
| org.apache.calcite.rel.rules |
Provides a core set of planner rules.
|
| org.apache.calcite.rex |
Provides a language for representing row-expressions.
|
| org.apache.calcite.schema |
Schema SPI.
|
| org.apache.calcite.sql2rel |
Translates a SQL parse tree to relational expression.
|
| Modifier and Type | Method and Description |
|---|---|
RexNode |
RexToLixTranslator.deref(RexNode expr)
Dereferences an expression if it is a
RexLocalRef. |
| Modifier and Type | Method and Description |
|---|---|
Map<RexNode,Boolean> |
NestedBlockBuilderImpl.currentNullables()
Returns the current nullability state of rex nodes.
|
Map<RexNode,Boolean> |
NestedBlockBuilder.currentNullables()
Returns the current nullability state of rex nodes.
|
List<RexNode> |
AggAddContext.rexArguments()
Returns
RexNode representation of arguments. |
List<RexNode> |
WinAggResultContext.rexArguments()
Returns
RexNode representation of arguments. |
| Modifier and Type | Method and Description |
|---|---|
EnumerableTableFunctionScan |
EnumerableTableFunctionScan.copy(RelTraitSet traitSet,
List<RelNode> inputs,
RexNode rexCall,
Type elementType,
RelDataType rowType,
Set<RelColumnMapping> columnMappings) |
EnumerableSort |
EnumerableSort.copy(RelTraitSet traitSet,
RelNode newInput,
RelCollation newCollation,
RexNode offset,
RexNode fetch) |
EnumerableFilter |
EnumerableFilter.copy(RelTraitSet traitSet,
RelNode input,
RexNode condition) |
EnumerableJoin |
EnumerableJoin.copy(RelTraitSet traitSet,
RexNode condition,
RelNode left,
RelNode right,
JoinRelType joinType,
boolean semiJoinDone) |
SemiJoin |
EnumerableSemiJoin.copy(RelTraitSet traitSet,
RexNode condition,
RelNode left,
RelNode right,
JoinRelType joinType,
boolean semiJoinDone) |
EnumerableMergeJoin |
EnumerableMergeJoin.copy(RelTraitSet traitSet,
RexNode condition,
RelNode left,
RelNode right,
JoinRelType joinType,
boolean semiJoinDone) |
EnumerableThetaJoin |
EnumerableThetaJoin.copy(RelTraitSet traitSet,
RexNode condition,
RelNode left,
RelNode right,
JoinRelType joinType,
boolean semiJoinDone) |
static EnumerableSort |
EnumerableSort.create(RelNode child,
RelCollation collation,
RexNode offset,
RexNode fetch)
Creates an EnumerableSort.
|
static EnumerableJoin |
EnumerableJoin.create(RelNode left,
RelNode right,
RexNode condition,
ImmutableIntList leftKeys,
ImmutableIntList rightKeys,
JoinRelType joinType,
Set<String> variablesStopped)
Creates an EnumerableJoin.
|
static EnumerableFilter |
EnumerableFilter.create(RelNode input,
RexNode condition)
Creates an EnumerableFilter.
|
static EnumerableLimit |
EnumerableLimit.create(RelNode input,
RexNode offset,
RexNode fetch)
Creates an EnumerableLimit.
|
RexNode |
RexToLixTranslator.deref(RexNode expr)
Dereferences an expression if it is a
RexLocalRef. |
protected Boolean |
RexToLixTranslator.isKnownNullable(RexNode node)
Walks parent translator chain and verifies if the expression is nullable.
|
boolean |
RexToLixTranslator.isNullable(RexNode e)
Returns whether an expression is nullable.
|
RexToLixTranslator |
RexToLixTranslator.setNullable(RexNode e,
boolean nullable)
Creates a read-only copy of this translator that records that a given
expression is nullable.
|
| Modifier and Type | Method and Description |
|---|---|
EnumerableProject |
EnumerableProject.copy(RelTraitSet traitSet,
RelNode input,
List<RexNode> projects,
RelDataType rowType) |
static EnumerableProject |
EnumerableProject.create(RelNode input,
List<? extends RexNode> projects,
RelDataType rowType)
Creates a LogicalProject, specifying row type rather than field names.
|
void |
NestedBlockBuilderImpl.nestBlock(BlockBuilder block,
Map<RexNode,Boolean> nullables)
Uses given block as the new code context and the map of nullability.
|
void |
NestedBlockBuilder.nestBlock(BlockBuilder block,
Map<RexNode,Boolean> nullables)
Uses given block as the new code context and the map of nullability.
|
RexToLixTranslator |
RexToLixTranslator.setNullable(Map<? extends RexNode,Boolean> nullable)
Creates a read-only copy of this translator that records that a given
expression is nullable.
|
Expression |
RexToLixTranslator.translateConstructor(List<RexNode> operandList,
SqlKind kind) |
List<Expression> |
RexToLixTranslator.translateList(List<? extends RexNode> operandList)
Translates the list of
RexNode, using the default output types. |
List<Expression> |
RexToLixTranslator.translateList(List<? extends RexNode> operandList,
List<? extends Type> storageTypes)
Translates the list of
RexNode, while optimizing for output
storage. |
List<Expression> |
RexToLixTranslator.translateList(List<RexNode> operandList,
RexImpTable.NullAs nullAs) |
| Constructor and Description |
|---|
EnumerableFilter(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode child,
RexNode condition)
Creates an EnumerableFilter.
|
EnumerableLimit(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
RexNode offset,
RexNode fetch)
Creates an EnumerableLimit.
|
EnumerableSort(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
RelCollation collation,
RexNode offset,
RexNode fetch)
Creates an EnumerableSort.
|
EnumerableTableFunctionScan(RelOptCluster cluster,
RelTraitSet traits,
List<RelNode> inputs,
Type elementType,
RelDataType rowType,
RexNode call,
Set<RelColumnMapping> columnMappings) |
EnumerableThetaJoin(RelOptCluster cluster,
RelTraitSet traits,
RelNode left,
RelNode right,
RexNode condition,
JoinRelType joinType,
Set<String> variablesStopped) |
| Constructor and Description |
|---|
EnumerableProject(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
List<? extends RexNode> projects,
RelDataType rowType)
Creates an EnumerableProject.
|
EnumerableProject(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
List<? extends RexNode> projects,
RelDataType rowType,
int flags)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
JdbcRules.JdbcSort |
JdbcRules.JdbcSort.copy(RelTraitSet traitSet,
RelNode newInput,
RelCollation newCollation,
RexNode offset,
RexNode fetch) |
JdbcRules.JdbcFilter |
JdbcRules.JdbcFilter.copy(RelTraitSet traitSet,
RelNode input,
RexNode condition) |
JdbcRules.JdbcJoin |
JdbcRules.JdbcJoin.copy(RelTraitSet traitSet,
RexNode condition,
RelNode left,
RelNode right,
JoinRelType joinType,
boolean semiJoinDone) |
| Modifier and Type | Method and Description |
|---|---|
JdbcRules.JdbcProject |
JdbcRules.JdbcProject.copy(RelTraitSet traitSet,
RelNode input,
List<RexNode> projects,
RelDataType rowType) |
| Constructor and Description |
|---|
JdbcRules.JdbcFilter(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
RexNode condition) |
JdbcRules.JdbcJoin(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode left,
RelNode right,
RexNode condition,
JoinRelType joinType,
Set<String> variablesStopped) |
| Constructor and Description |
|---|
JdbcRules.JdbcProject(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
List<? extends RexNode> projects,
RelDataType rowType) |
JdbcRules.JdbcProject(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
List<RexNode> projects,
RelDataType rowType,
int flags)
Deprecated.
|
| Modifier and Type | Field and Description |
|---|---|
com.google.common.collect.ImmutableList<RexNode> |
Bindables.BindableTableScan.filters |
| Modifier and Type | Method and Description |
|---|---|
Bindables.BindableSort |
Bindables.BindableSort.copy(RelTraitSet traitSet,
RelNode newInput,
RelCollation newCollation,
RexNode offset,
RexNode fetch) |
Bindables.BindableFilter |
Bindables.BindableFilter.copy(RelTraitSet traitSet,
RelNode input,
RexNode condition) |
Bindables.BindableJoin |
Bindables.BindableJoin.copy(RelTraitSet traitSet,
RexNode conditionExpr,
RelNode left,
RelNode right,
JoinRelType joinType,
boolean semiJoinDone) |
static Bindables.BindableFilter |
Bindables.BindableFilter.create(RelNode input,
RexNode condition)
Creates a BindableFilter.
|
| Modifier and Type | Method and Description |
|---|---|
Scalar |
JaninoRexCompiler.compile(List<RexNode> nodes,
RelDataType inputRowType) |
Scalar |
Interpreter.compile(List<RexNode> nodes,
RelDataType inputRowType)
Compiles an expression to an executable form.
|
Bindables.BindableProject |
Bindables.BindableProject.copy(RelTraitSet traitSet,
RelNode input,
List<RexNode> projects,
RelDataType rowType) |
static Bindables.BindableTableScan |
Bindables.BindableTableScan.create(RelOptCluster cluster,
RelOptTable relOptTable,
List<RexNode> filters,
List<Integer> projects)
Creates a BindableTableScan.
|
| Constructor and Description |
|---|
Bindables.BindableFilter(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
RexNode condition) |
Bindables.BindableJoin(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode left,
RelNode right,
RexNode condition,
JoinRelType joinType,
Set<String> variablesStopped) |
Bindables.BindableSort(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
RelCollation collation,
RexNode offset,
RexNode fetch) |
| Constructor and Description |
|---|
Bindables.BindableProject(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
List<? extends RexNode> projects,
RelDataType rowType) |
| Modifier and Type | Field and Description |
|---|---|
com.google.common.collect.ImmutableList<RexNode> |
RelOptPredicateList.leftInferredPredicates |
com.google.common.collect.ImmutableList<RexNode> |
RelOptPredicateList.pulledUpPredicates |
com.google.common.collect.ImmutableList<RexNode> |
RelOptPredicateList.rightInferredPredicates |
| Modifier and Type | Method and Description |
|---|---|
static RexNode |
RelOptUtil.andJoinFilters(RexBuilder rexBuilder,
RexNode left,
RexNode right)
Ands two sets of join filters together, either of which can be null.
|
static RexNode |
RelOptUtil.createEquiJoinCondition(RelNode left,
List<Integer> leftKeys,
RelNode right,
List<Integer> rightKeys,
RexBuilder rexBuilder)
Builds an equi-join condition from a set of left and right keys.
|
RexNode |
RelOptCluster.getOriginalExpression() |
static RexNode |
RelOptUtil.isDistinctFrom(RexBuilder rexBuilder,
RexNode x,
RexNode y,
boolean neg)
Returns a translation of the
IS DISTINCT FROM (or IS
NOT DISTINCT FROM) sql operator. |
static RexNode |
RelOptUtil.pushFilterPastProject(RexNode filter,
Project projRel)
Converts a filter to the new filter that would result if the filter is
pushed past a LogicalProject that it currently is referencing.
|
static RexNode |
SubstitutionVisitor.simplify(RexBuilder rexBuilder,
RexNode e)
Simplifies a boolean expression.
|
static RexNode |
RelOptUtil.splitCorrelatedFilterCondition(LogicalFilter filter,
List<RexInputRef> joinKeys,
List<RexNode> correlatedJoinKeys) |
static RexNode |
RelOptUtil.splitCorrelatedFilterCondition(LogicalFilter filter,
List<RexNode> joinKeys,
List<RexNode> correlatedJoinKeys,
boolean extractCorrelatedFieldAccess) |
static RexNode |
SubstitutionVisitor.splitFilter(RexBuilder rexBuilder,
RexNode condition,
RexNode target)
Maps a condition onto a target.
|
static RexNode |
RelOptUtil.splitJoinCondition(List<RelDataTypeField> sysFieldList,
List<RelNode> inputs,
RexNode condition,
List<List<RexNode>> joinKeys,
List<Integer> filterNulls,
List<SqlOperator> rangeOp)
Splits out the equi-join (and optionally, a single non-equi) components
of a join condition, and returns what's left.
|
static RexNode |
RelOptUtil.splitJoinCondition(List<RelDataTypeField> sysFieldList,
RelNode leftRel,
RelNode rightRel,
RexNode condition,
List<RexNode> leftJoinKeys,
List<RexNode> rightJoinKeys,
List<Integer> filterNulls,
List<SqlOperator> rangeOp)
Splits out the equi-join (and optionally, a single non-equi) components
of a join condition, and returns what's left.
|
static RexNode |
RelOptUtil.splitJoinCondition(RelNode left,
RelNode right,
RexNode condition,
List<Integer> leftKeys,
List<Integer> rightKeys)
Splits out the equi-join components of a join condition, and returns
what's left.
|
RexNode |
RelOptUtil.VariableUsedVisitor.visitCorrelVariable(RexCorrelVariable p) |
RexNode |
RelOptUtil.InputReferencedVisitor.visitInputRef(RexInputRef inputRef) |
RexNode |
RelOptUtil.RexInputConverter.visitInputRef(RexInputRef var) |
| Modifier and Type | Method and Description |
|---|---|
static List<RexNode> |
RelOptUtil.conjunctions(RexNode rexPredicate)
Returns a condition decomposed by AND.
|
static List<RexNode> |
RelOptUtil.createSwappedJoinExprs(RelNode newJoin,
Join origJoin,
boolean origOrder)
Creates projection expressions reflecting the swapping of a join's input.
|
static List<RexNode> |
RelOptUtil.disjunctions(RexNode rexPredicate)
Returns a condition decomposed by OR.
|
static com.google.common.base.Function<RexNode,RexNode> |
SubstitutionVisitor.not(RexBuilder rexBuilder)
Returns a function that applies NOT to its argument.
|
static com.google.common.base.Function<RexNode,RexNode> |
SubstitutionVisitor.not(RexBuilder rexBuilder)
Returns a function that applies NOT to its argument.
|
| Modifier and Type | Method and Description |
|---|---|
static RelOptUtil.InputFinder |
RelOptUtil.InputFinder.analyze(RexNode node)
Returns an input finder that has analyzed a given expression.
|
static RexNode |
RelOptUtil.andJoinFilters(RexBuilder rexBuilder,
RexNode left,
RexNode right)
Ands two sets of join filters together, either of which can be null.
|
static ImmutableBitSet |
RelOptUtil.InputFinder.bits(List<RexNode> exprs,
RexNode expr)
Returns a bit set describing the inputs used by a collection of
project expressions and an optional condition.
|
static ImmutableBitSet |
RelOptUtil.InputFinder.bits(RexNode node)
Returns a bit set describing the inputs used by an expression.
|
static List<RexNode> |
RelOptUtil.conjunctions(RexNode rexPredicate)
Returns a condition decomposed by AND.
|
static RelNode |
RelOptUtil.createFilter(RelNode child,
RexNode condition)
Creates a relational expression which filters according to a given
condition, returning the same fields as its input, using the default
filter factory.
|
static RelNode |
RelOptUtil.createFilter(RelNode child,
RexNode condition,
RelFactories.FilterFactory filterFactory)
Creates a relational expression which filters according to a given
condition, returning the same fields as its input.
|
static void |
RelOptUtil.decomposeConjunction(RexNode rexPredicate,
List<RexNode> rexList)
Decomposes a predicate into a list of expressions that are AND'ed
together.
|
static void |
RelOptUtil.decomposeConjunction(RexNode rexPredicate,
List<RexNode> rexList,
List<RexNode> notList)
Decomposes a predicate into a list of expressions that are AND'ed
together, and a list of expressions that are preceded by NOT.
|
static void |
RelOptUtil.decomposeDisjunction(RexNode rexPredicate,
List<RexNode> rexList)
Decomposes a predicate into a list of expressions that are OR'ed
together.
|
static List<RexNode> |
RelOptUtil.disjunctions(RexNode rexPredicate)
Returns a condition decomposed by OR.
|
static boolean |
Strong.is(RexNode node,
ImmutableBitSet nullColumns)
Returns whether the analyzed expression will return null if a given set
of input columns are null.
|
static RexNode |
RelOptUtil.isDistinctFrom(RexBuilder rexBuilder,
RexNode x,
RexNode y,
boolean neg)
Returns a translation of the
IS DISTINCT FROM (or IS
NOT DISTINCT FROM) sql operator. |
static boolean |
RelOptUtil.isEqui(RelNode left,
RelNode right,
RexNode condition)
Returns whether a join condition is an "equi-join" condition.
|
static boolean |
SubstitutionVisitor.mayBeSatisfiable(RexNode e)
Returns whether a boolean expression ever returns true.
|
static RexNode |
RelOptUtil.pushFilterPastProject(RexNode filter,
Project projRel)
Converts a filter to the new filter that would result if the filter is
pushed past a LogicalProject that it currently is referencing.
|
void |
RelOptCluster.setOriginalExpression(RexNode originalExpression) |
static RexNode |
SubstitutionVisitor.simplify(RexBuilder rexBuilder,
RexNode e)
Simplifies a boolean expression.
|
static RexNode |
SubstitutionVisitor.splitFilter(RexBuilder rexBuilder,
RexNode condition,
RexNode target)
Maps a condition onto a target.
|
static void |
RelOptUtil.splitFilters(ImmutableBitSet childBitmap,
RexNode predicate,
List<RexNode> pushable,
List<RexNode> notPushable)
Splits a filter into two lists, depending on whether or not the filter
only references its child input
|
static RexNode |
RelOptUtil.splitJoinCondition(List<RelDataTypeField> sysFieldList,
List<RelNode> inputs,
RexNode condition,
List<List<RexNode>> joinKeys,
List<Integer> filterNulls,
List<SqlOperator> rangeOp)
Splits out the equi-join (and optionally, a single non-equi) components
of a join condition, and returns what's left.
|
static RexNode |
RelOptUtil.splitJoinCondition(List<RelDataTypeField> sysFieldList,
RelNode leftRel,
RelNode rightRel,
RexNode condition,
List<RexNode> leftJoinKeys,
List<RexNode> rightJoinKeys,
List<Integer> filterNulls,
List<SqlOperator> rangeOp)
Splits out the equi-join (and optionally, a single non-equi) components
of a join condition, and returns what's left.
|
static RexNode |
RelOptUtil.splitJoinCondition(RelNode left,
RelNode right,
RexNode condition,
List<Integer> leftKeys,
List<Integer> rightKeys)
Splits out the equi-join components of a join condition, and returns
what's left.
|
| Modifier and Type | Method and Description |
|---|---|
static ImmutableBitSet |
RelOptUtil.InputFinder.bits(List<RexNode> exprs,
RexNode expr)
Returns a bit set describing the inputs used by a collection of
project expressions and an optional condition.
|
static boolean |
RelOptUtil.classifyFilters(RelNode joinRel,
List<RexNode> filters,
JoinRelType joinType,
boolean pushInto,
boolean pushLeft,
boolean pushRight,
List<RexNode> joinFilters,
List<RexNode> leftFilters,
List<RexNode> rightFilters)
Classifies filters according to where they should be processed.
|
static boolean |
RelOptUtil.classifyFilters(RelNode joinRel,
List<RexNode> filters,
JoinRelType joinType,
boolean pushInto,
boolean pushLeft,
boolean pushRight,
List<RexNode> joinFilters,
List<RexNode> leftFilters,
List<RexNode> rightFilters)
Classifies filters according to where they should be processed.
|
static boolean |
RelOptUtil.classifyFilters(RelNode joinRel,
List<RexNode> filters,
JoinRelType joinType,
boolean pushInto,
boolean pushLeft,
boolean pushRight,
List<RexNode> joinFilters,
List<RexNode> leftFilters,
List<RexNode> rightFilters)
Classifies filters according to where they should be processed.
|
static boolean |
RelOptUtil.classifyFilters(RelNode joinRel,
List<RexNode> filters,
JoinRelType joinType,
boolean pushInto,
boolean pushLeft,
boolean pushRight,
List<RexNode> joinFilters,
List<RexNode> leftFilters,
List<RexNode> rightFilters)
Classifies filters according to where they should be processed.
|
static RelNode |
RelOptUtil.createExistsPlan(RelOptCluster cluster,
RelNode seekRel,
List<RexNode> conditions,
RexLiteral extraExpr,
String extraName)
Creates a plan suitable for use in
EXISTS or IN
statements. |
static RelNode |
RelOptUtil.createFilter(RelNode child,
Iterable<? extends RexNode> conditions)
Creates a filter, using the default filter factory,
or returns the original relational expression if the
condition is trivial.
|
static RelNode |
RelOptUtil.createFilter(RelNode child,
Iterable<? extends RexNode> conditions,
RelFactories.FilterFactory filterFactory)
Creates a filter using the default factory,
or returns the original relational expression if the
condition is trivial.
|
static RelNode |
RelOptUtil.createProject(RelNode child,
List<? extends RexNode> exprList,
List<String> fieldNameList)
Creates a relational expression which projects a list of expressions.
|
static RelNode |
RelOptUtil.createProject(RelNode child,
List<? extends RexNode> exprs,
List<String> fieldNames,
boolean optimize)
Creates a relational expression which projects an array of expressions,
and optionally optimizes.
|
static RelNode |
RelOptUtil.createProject(RelNode child,
List<Pair<RexNode,String>> projectList,
boolean optimize)
Creates a relational expression which projects a list of (expression, name)
pairs.
|
static void |
RelOptUtil.decomposeConjunction(RexNode rexPredicate,
List<RexNode> rexList)
Decomposes a predicate into a list of expressions that are AND'ed
together.
|
static void |
RelOptUtil.decomposeConjunction(RexNode rexPredicate,
List<RexNode> rexList,
List<RexNode> notList)
Decomposes a predicate into a list of expressions that are AND'ed
together, and a list of expressions that are preceded by NOT.
|
static void |
RelOptUtil.decomposeConjunction(RexNode rexPredicate,
List<RexNode> rexList,
List<RexNode> notList)
Decomposes a predicate into a list of expressions that are AND'ed
together, and a list of expressions that are preceded by NOT.
|
static void |
RelOptUtil.decomposeDisjunction(RexNode rexPredicate,
List<RexNode> rexList)
Decomposes a predicate into a list of expressions that are OR'ed
together.
|
static RelOptPredicateList |
RelOptPredicateList.of(Iterable<RexNode> pulledUpPredicates) |
static RelOptPredicateList |
RelOptPredicateList.of(Iterable<RexNode> pulledUpPredicates,
Iterable<RexNode> leftInferredPredicates,
Iterable<RexNode> rightInferredPredicates) |
static RelOptPredicateList |
RelOptPredicateList.of(Iterable<RexNode> pulledUpPredicates,
Iterable<RexNode> leftInferredPredicates,
Iterable<RexNode> rightInferredPredicates) |
static RelOptPredicateList |
RelOptPredicateList.of(Iterable<RexNode> pulledUpPredicates,
Iterable<RexNode> leftInferredPredicates,
Iterable<RexNode> rightInferredPredicates) |
static Mappings.TargetMapping |
RelOptUtil.permutation(List<RexNode> nodes,
RelDataType inputRowType)
Returns a permutation describing where output fields come from.
|
static void |
RelOptUtil.projectJoinInputs(RelNode[] inputRels,
List<RexNode> leftJoinKeys,
List<RexNode> rightJoinKeys,
int systemColCount,
List<Integer> leftKeys,
List<Integer> rightKeys,
List<Integer> outputProj)
Adding projection to the inputs of a join to produce the required join
keys.
|
static void |
RelOptUtil.projectJoinInputs(RelNode[] inputRels,
List<RexNode> leftJoinKeys,
List<RexNode> rightJoinKeys,
int systemColCount,
List<Integer> leftKeys,
List<Integer> rightKeys,
List<Integer> outputProj)
Adding projection to the inputs of a join to produce the required join
keys.
|
void |
RelOptPlanner.Executor.reduce(RexBuilder rexBuilder,
List<RexNode> constExps,
List<RexNode> reducedValues)
Reduces expressions, and writes their results into
reducedValues. |
void |
RelOptPlanner.Executor.reduce(RexBuilder rexBuilder,
List<RexNode> constExps,
List<RexNode> reducedValues)
Reduces expressions, and writes their results into
reducedValues. |
static JoinRelType |
RelOptUtil.simplifyJoin(RelNode joinRel,
com.google.common.collect.ImmutableList<RexNode> aboveFilters,
JoinRelType joinType)
Simplifies outer joins if filter above would reject nulls.
|
static RexNode |
RelOptUtil.splitCorrelatedFilterCondition(LogicalFilter filter,
List<RexInputRef> joinKeys,
List<RexNode> correlatedJoinKeys) |
static RexNode |
RelOptUtil.splitCorrelatedFilterCondition(LogicalFilter filter,
List<RexNode> joinKeys,
List<RexNode> correlatedJoinKeys,
boolean extractCorrelatedFieldAccess) |
static RexNode |
RelOptUtil.splitCorrelatedFilterCondition(LogicalFilter filter,
List<RexNode> joinKeys,
List<RexNode> correlatedJoinKeys,
boolean extractCorrelatedFieldAccess) |
static void |
RelOptUtil.splitFilters(ImmutableBitSet childBitmap,
RexNode predicate,
List<RexNode> pushable,
List<RexNode> notPushable)
Splits a filter into two lists, depending on whether or not the filter
only references its child input
|
static void |
RelOptUtil.splitFilters(ImmutableBitSet childBitmap,
RexNode predicate,
List<RexNode> pushable,
List<RexNode> notPushable)
Splits a filter into two lists, depending on whether or not the filter
only references its child input
|
static RexNode |
RelOptUtil.splitJoinCondition(List<RelDataTypeField> sysFieldList,
List<RelNode> inputs,
RexNode condition,
List<List<RexNode>> joinKeys,
List<Integer> filterNulls,
List<SqlOperator> rangeOp)
Splits out the equi-join (and optionally, a single non-equi) components
of a join condition, and returns what's left.
|
static RexNode |
RelOptUtil.splitJoinCondition(List<RelDataTypeField> sysFieldList,
RelNode leftRel,
RelNode rightRel,
RexNode condition,
List<RexNode> leftJoinKeys,
List<RexNode> rightJoinKeys,
List<Integer> filterNulls,
List<SqlOperator> rangeOp)
Splits out the equi-join (and optionally, a single non-equi) components
of a join condition, and returns what's left.
|
static RexNode |
RelOptUtil.splitJoinCondition(List<RelDataTypeField> sysFieldList,
RelNode leftRel,
RelNode rightRel,
RexNode condition,
List<RexNode> leftJoinKeys,
List<RexNode> rightJoinKeys,
List<Integer> filterNulls,
List<SqlOperator> rangeOp)
Splits out the equi-join (and optionally, a single non-equi) components
of a join condition, and returns what's left.
|
| Modifier and Type | Method and Description |
|---|---|
RexNode |
RelInput.getExpression(String tag)
Returns an expression.
|
| Modifier and Type | Method and Description |
|---|---|
List<RexNode> |
AbstractRelNode.getChildExps() |
List<RexNode> |
RelNode.getChildExps()
Deprecated.
use #accept(org.apache.calcite.rex.RexShuttle)
|
List<RexNode> |
RelInput.getExpressionList(String tag) |
| Modifier and Type | Class and Description |
|---|---|
static class |
Window.RexWinAggCall
A call to a windowed aggregate function.
|
| Modifier and Type | Field and Description |
|---|---|
protected RexNode |
Join.condition |
protected RexNode |
Filter.condition |
RexNode |
Sort.fetch |
RexNode |
Sort.offset |
| Modifier and Type | Field and Description |
|---|---|
protected com.google.common.collect.ImmutableList<RexNode> |
Project.exps |
protected com.google.common.collect.ImmutableList<RexNode> |
Sort.fieldExps |
| Modifier and Type | Method and Description |
|---|---|
RexNode |
TableFunctionScan.getCall()
Returns function invocation expression.
|
RexNode |
Join.getCondition() |
RexNode |
Filter.getCondition() |
RexNode |
JoinInfo.getEquiCondition(RelNode left,
RelNode right,
RexBuilder rexBuilder) |
abstract RexNode |
JoinInfo.getRemaining(RexBuilder rexBuilder) |
| Modifier and Type | Method and Description |
|---|---|
List<RexNode> |
Sort.getChildExps() |
List<RexNode> |
TableFunctionScan.getChildExps() |
List<RexNode> |
Join.getChildExps() |
List<RexNode> |
Filter.getChildExps() |
List<RexNode> |
Project.getChildExps() |
List<Pair<RexNode,String>> |
Project.getNamedProjects()
Returns a list of (expression, name) pairs.
|
List<RexNode> |
Project.getProjects()
Returns the project expressions.
|
| Modifier and Type | Method and Description |
|---|---|
abstract TableFunctionScan |
TableFunctionScan.copy(RelTraitSet traitSet,
List<RelNode> inputs,
RexNode rexCall,
Type elementType,
RelDataType rowType,
Set<RelColumnMapping> columnMappings)
Copies this relational expression, substituting traits and
inputs.
|
abstract Sort |
Sort.copy(RelTraitSet traitSet,
RelNode newInput,
RelCollation newCollation,
RexNode offset,
RexNode fetch) |
abstract Filter |
Filter.copy(RelTraitSet traitSet,
RelNode input,
RexNode condition) |
abstract Join |
Join.copy(RelTraitSet traitSet,
RexNode conditionExpr,
RelNode left,
RelNode right,
JoinRelType joinType,
boolean semiJoinDone)
Creates a copy of this join, overriding condition, system fields and
inputs.
|
SemiJoin |
SemiJoin.copy(RelTraitSet traitSet,
RexNode condition,
RelNode left,
RelNode right,
JoinRelType joinType,
boolean semiJoinDone) |
RelNode |
RelFactories.FilterFactory.createFilter(RelNode child,
RexNode condition)
Creates a filter.
|
RelNode |
RelFactories.JoinFactory.createJoin(RelNode left,
RelNode right,
RexNode condition,
JoinRelType joinType,
Set<String> variablesStopped,
boolean semiJoinDone)
Creates a join.
|
RelNode |
RelFactories.SemiJoinFactory.createSemiJoin(RelNode left,
RelNode right,
RexNode condition)
Creates a semi-join.
|
RelNode |
RelFactories.SortFactory.createSort(RelTraitSet traits,
RelNode child,
RelCollation collation,
RexNode offset,
RexNode fetch)
Creates a sort.
|
static double |
Filter.estimateFilteredRows(RelNode child,
RexNode condition) |
static double |
Join.estimateJoinedRows(Join joinRel,
RexNode condition) |
static JoinInfo |
JoinInfo.of(RelNode left,
RelNode right,
RexNode condition)
Creates a
JoinInfo by analyzing a condition. |
| Modifier and Type | Method and Description |
|---|---|
RexCall |
Window.RexWinAggCall.clone(RelDataType type,
List<RexNode> operands) |
abstract Project |
Project.copy(RelTraitSet traitSet,
RelNode input,
List<RexNode> projects,
RelDataType rowType)
Copies a project.
|
Project |
Project.copy(RelTraitSet traitSet,
RelNode input,
List<RexNode> projects,
RelDataType rowType,
int flags)
Deprecated.
|
RelNode |
RelFactories.ProjectFactory.createProject(RelNode child,
List<? extends RexNode> childExprs,
List<String> fieldNames)
Creates a project.
|
static Mappings.TargetMapping |
Project.getMapping(int inputFieldCount,
List<? extends RexNode> projects)
Returns a mapping of a set of project expressions.
|
static Mappings.TargetMapping |
Project.getPartialMapping(int inputFieldCount,
List<? extends RexNode> projects)
Returns a partial mapping of a set of project expressions.
|
static Permutation |
Project.getPermutation(int inputFieldCount,
List<? extends RexNode> projects)
Returns a permutation, if this projection is merely a permutation of its
input fields; otherwise null.
|
static ImmutableIntList |
Window.getProjectOrdinals(List<RexNode> exprs) |
| Constructor and Description |
|---|
EquiJoin(RelOptCluster cluster,
RelTraitSet traits,
RelNode left,
RelNode right,
RexNode condition,
ImmutableIntList leftKeys,
ImmutableIntList rightKeys,
JoinRelType joinType,
Set<String> variablesStopped)
Creates an EquiJoin.
|
Filter(RelOptCluster cluster,
RelTraitSet traits,
RelNode child,
RexNode condition)
Creates a filter.
|
Join(RelOptCluster cluster,
RelTraitSet traits,
RelNode left,
RelNode right,
RexNode condition,
JoinRelType joinType,
Set<String> variablesStopped)
Creates a Join.
|
SemiJoin(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode left,
RelNode right,
RexNode condition,
ImmutableIntList leftKeys,
ImmutableIntList rightKeys)
Creates a SemiJoin.
|
Sort(RelOptCluster cluster,
RelTraitSet traits,
RelNode child,
RelCollation collation,
RexNode offset,
RexNode fetch)
Creates a Sort.
|
TableFunctionScan(RelOptCluster cluster,
RelTraitSet traits,
List<RelNode> inputs,
RexNode rexCall,
Type elementType,
RelDataType rowType,
Set<RelColumnMapping> columnMappings)
Creates a
TableFunctionScan. |
| Constructor and Description |
|---|
Project(RelOptCluster cluster,
RelTraitSet traits,
RelNode input,
List<? extends RexNode> projects,
RelDataType rowType)
Creates a Project.
|
Project(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
List<? extends RexNode> projects,
RelDataType rowType,
int flags)
Deprecated.
|
Window.RexWinAggCall(SqlAggFunction aggFun,
RelDataType type,
List<RexNode> operands,
int ordinal)
Creates a RexWinAggCall.
|
| Modifier and Type | Method and Description |
|---|---|
LogicalTableFunctionScan |
LogicalTableFunctionScan.copy(RelTraitSet traitSet,
List<RelNode> inputs,
RexNode rexCall,
Type elementType,
RelDataType rowType,
Set<RelColumnMapping> columnMappings) |
Sort |
LogicalSort.copy(RelTraitSet traitSet,
RelNode newInput,
RelCollation newCollation,
RexNode offset,
RexNode fetch) |
LogicalFilter |
LogicalFilter.copy(RelTraitSet traitSet,
RelNode input,
RexNode condition) |
LogicalJoin |
LogicalJoin.copy(RelTraitSet traitSet,
RexNode conditionExpr,
RelNode left,
RelNode right,
JoinRelType joinType,
boolean semiJoinDone) |
static LogicalSort |
LogicalSort.create(RelNode input,
RelCollation collation,
RexNode offset,
RexNode fetch)
Creates a LogicalSort.
|
static LogicalJoin |
LogicalJoin.create(RelNode left,
RelNode right,
RexNode condition,
JoinRelType joinType,
Set<String> variablesStopped)
Creates a LogicalJoin.
|
static LogicalJoin |
LogicalJoin.create(RelNode left,
RelNode right,
RexNode condition,
JoinRelType joinType,
Set<String> variablesStopped,
boolean semiJoinDone,
com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList)
Creates a LogicalJoin, flagged with whether it has been translated to a
semi-join.
|
static LogicalFilter |
LogicalFilter.create(RelNode input,
RexNode condition)
Creates a LogicalFilter.
|
static LogicalTableFunctionScan |
LogicalTableFunctionScan.create(RelOptCluster cluster,
List<RelNode> inputs,
RexNode rexCall,
Type elementType,
RelDataType rowType,
Set<RelColumnMapping> columnMappings)
Creates a LogicalTableFunctionScan.
|
| Modifier and Type | Method and Description |
|---|---|
LogicalProject |
LogicalProject.copy(RelTraitSet traitSet,
RelNode input,
List<RexNode> projects,
RelDataType rowType) |
static LogicalProject |
LogicalProject.create(RelNode input,
List<? extends RexNode> projects,
List<String> fieldNames)
Creates a LogicalProject.
|
static LogicalProject |
LogicalProject.create(RelNode input,
List<? extends RexNode> projects,
RelDataType rowType)
Creates a LogicalProject, specifying row type rather than field names.
|
| Constructor and Description |
|---|
LogicalFilter(RelOptCluster cluster,
RelNode child,
RexNode condition)
Deprecated.
|
LogicalFilter(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode child,
RexNode condition)
Creates a LogicalFilter.
|
LogicalJoin(RelOptCluster cluster,
RelNode left,
RelNode right,
RexNode condition,
JoinRelType joinType,
Set<String> variablesStopped)
Deprecated.
|
LogicalJoin(RelOptCluster cluster,
RelNode left,
RelNode right,
RexNode condition,
JoinRelType joinType,
Set<String> variablesStopped,
boolean semiJoinDone,
com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList)
Deprecated.
|
LogicalJoin(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode left,
RelNode right,
RexNode condition,
JoinRelType joinType,
Set<String> variablesStopped,
boolean semiJoinDone,
com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList)
Creates a LogicalJoin.
|
LogicalTableFunctionScan(RelOptCluster cluster,
List<RelNode> inputs,
RexNode rexCall,
Type elementType,
RelDataType rowType,
Set<RelColumnMapping> columnMappings)
Deprecated.
|
LogicalTableFunctionScan(RelOptCluster cluster,
RelTraitSet traitSet,
List<RelNode> inputs,
RexNode rexCall,
Type elementType,
RelDataType rowType,
Set<RelColumnMapping> columnMappings)
Creates a
LogicalTableFunctionScan. |
| Constructor and Description |
|---|
LogicalProject(RelOptCluster cluster,
RelNode input,
List<RexNode> projects,
List<String> fieldNames,
int flags)
Deprecated.
|
LogicalProject(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
List<? extends RexNode> projects,
RelDataType rowType)
Creates a LogicalProject.
|
LogicalProject(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
List<? extends RexNode> projects,
RelDataType rowType,
int flags)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static RexNode |
RelMdUtil.makeSemiJoinSelectivityRexNode(SemiJoin rel)
Creates a RexNode that stores a selectivity value corresponding to the
selectivity of a semijoin.
|
static RexNode |
RelMdUtil.minusPreds(RexBuilder rexBuilder,
RexNode pred1,
RexNode pred2)
Takes the difference between two predicates, removing from the first any
predicates also in the second
|
static RexNode |
RelMdUtil.unionPreds(RexBuilder rexBuilder,
RexNode pred1,
RexNode pred2)
AND's two predicates together, either of which may be null, removing
redundant filters.
|
| Modifier and Type | Method and Description |
|---|---|
Double |
RelMdSize.averageRexSize(RexNode node,
List<Double> inputColumnSizes) |
static Double |
RelMdUtil.cardOfProjExpr(Project rel,
RexNode expr)
Computes the cardinality of a particular expression from the projection
list
|
Double |
RelMdDistinctRowCount.getDistinctRowCount(Aggregate rel,
ImmutableBitSet groupKey,
RexNode predicate) |
Double |
RelMdDistinctRowCount.getDistinctRowCount(Exchange rel,
ImmutableBitSet groupKey,
RexNode predicate) |
Double |
RelMdDistinctRowCount.getDistinctRowCount(Filter rel,
ImmutableBitSet groupKey,
RexNode predicate) |
Double |
BuiltInMetadata.DistinctRowCount.getDistinctRowCount(ImmutableBitSet groupKey,
RexNode predicate)
Estimates the number of rows which would be produced by a GROUP BY on the
set of columns indicated by groupKey, where the input to the GROUP BY has
been pre-filtered by predicate.
|
Double |
RelMdDistinctRowCount.getDistinctRowCount(Join rel,
ImmutableBitSet groupKey,
RexNode predicate) |
Double |
RelMdDistinctRowCount.getDistinctRowCount(Project rel,
ImmutableBitSet groupKey,
RexNode predicate) |
Double |
RelMdDistinctRowCount.getDistinctRowCount(RelNode rel,
ImmutableBitSet groupKey,
RexNode predicate) |
static Double |
RelMetadataQuery.getDistinctRowCount(RelNode rel,
ImmutableBitSet groupKey,
RexNode predicate)
|
Double |
RelMdDistinctRowCount.getDistinctRowCount(SemiJoin rel,
ImmutableBitSet groupKey,
RexNode predicate) |
Double |
RelMdDistinctRowCount.getDistinctRowCount(Sort rel,
ImmutableBitSet groupKey,
RexNode predicate) |
Double |
RelMdDistinctRowCount.getDistinctRowCount(Union rel,
ImmutableBitSet groupKey,
RexNode predicate) |
Double |
RelMdDistinctRowCount.getDistinctRowCount(Values rel,
ImmutableBitSet groupKey,
RexNode predicate) |
static Double |
RelMdUtil.getJoinDistinctRowCount(RelNode joinRel,
JoinRelType joinType,
ImmutableBitSet groupKey,
RexNode predicate,
boolean useMaxNdv)
Computes the number of distinct rows for a set of keys returned from a
join.
|
Double |
RelMdSelectivity.getSelectivity(Aggregate rel,
RexNode predicate) |
Double |
RelMdSelectivity.getSelectivity(Filter rel,
RexNode predicate) |
Double |
RelMdSelectivity.getSelectivity(Project rel,
RexNode predicate) |
static Double |
RelMetadataQuery.getSelectivity(RelNode rel,
RexNode predicate)
Returns the
BuiltInMetadata.Selectivity.getSelectivity(RexNode)
statistic. |
Double |
RelMdSelectivity.getSelectivity(RelNode rel,
RexNode predicate) |
Double |
BuiltInMetadata.Selectivity.getSelectivity(RexNode predicate)
Estimates the percentage of an expression's output rows which satisfy a
given predicate.
|
Double |
RelMdSelectivity.getSelectivity(SemiJoin rel,
RexNode predicate) |
Double |
RelMdSelectivity.getSelectivity(Sort rel,
RexNode predicate) |
Double |
RelMdSelectivity.getSelectivity(Union rel,
RexNode predicate) |
static double |
RelMdUtil.getSelectivityValue(RexNode artificialSelecFuncNode)
Returns the selectivity value stored in the rexnode
|
static double |
RelMdUtil.guessSelectivity(RexNode predicate)
Returns default estimates for selectivities, in the absence of stats.
|
static double |
RelMdUtil.guessSelectivity(RexNode predicate,
boolean artificialOnly)
Returns default estimates for selectivities, in the absence of stats.
|
static RexNode |
RelMdUtil.minusPreds(RexBuilder rexBuilder,
RexNode pred1,
RexNode pred2)
Takes the difference between two predicates, removing from the first any
predicates also in the second
|
static RexNode |
RelMdUtil.unionPreds(RexBuilder rexBuilder,
RexNode pred1,
RexNode pred2)
AND's two predicates together, either of which may be null, removing
redundant filters.
|
| Modifier and Type | Method and Description |
|---|---|
static List<RelCollation> |
RelMdCollation.project(RelNode input,
List<? extends RexNode> projects)
Helper method to determine a
Project's collation. |
static RelDistribution |
RelMdDistribution.project(RelNode input,
List<? extends RexNode> projects)
Helper method to determine a
Project's collation. |
static void |
RelMdUtil.splitCols(List<RexNode> projExprs,
ImmutableBitSet groupKey,
ImmutableBitSet.Builder baseCols,
ImmutableBitSet.Builder projCols)
Forms two bitmaps by splitting the columns in a bitmap according to
whether or not the column references the child input or is an expression
|
| Modifier and Type | Method and Description |
|---|---|
protected RexNode |
ReduceDecimalsRule.RexExpander.accessValue(RexNode node)
Retrieves the primitive value of a numeric node.
|
RexNode |
PushProjector.convertRefsAndExprs(RexNode rex,
List<RelDataTypeField> destFields,
int[] adjustments)
Clones an expression tree and walks through it, adjusting each
RexInputRef index by some amount, and converting expressions that need to
be preserved to field references.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.decodeValue(RexNode decimalNode)
Retrieves a decimal node's integer representation
|
protected RexNode |
ReduceDecimalsRule.RexExpander.encodeValue(RexNode value,
RelDataType decimalType)
Casts a decimal's integer representation to a decimal node.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.encodeValue(RexNode value,
RelDataType decimalType,
boolean checkOverflow)
Casts a decimal's integer representation to a decimal node.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.ensureScale(RexNode value,
int scale,
int required)
Ensures a value is of a required scale.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.ensureType(RelDataType type,
RexNode node)
Ensures expression is interpreted as a specified type.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.ensureType(RelDataType type,
RexNode node,
boolean matchNullability)
Ensures expression is interpreted as a specified type.
|
abstract RexNode |
ReduceDecimalsRule.RexExpander.expand(RexCall call)
Rewrites an expression containing decimals.
|
RexNode |
MultiJoin.getJoinFilter() |
RexNode |
LoptMultiJoin.getOuterJoinCond(int factIdx) |
RexNode |
MultiJoin.getPostJoinFilter() |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeApproxLiteral(BigDecimal bd)
Makes an approximate literal of double precision
|
protected RexNode |
ReduceDecimalsRule.RexExpander.makeApproxScaleFactor(int scale)
Makes an approximate literal to be used for scaling
|
protected RexNode |
ReduceDecimalsRule.RexExpander.makeCase(RexNode condition,
RexNode thenClause,
RexNode elseClause) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeCase(RexNode whenA,
RexNode thenA,
RexNode whenB,
RexNode thenB,
RexNode elseClause) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeDivide(RexNode a,
RexNode b) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeExactLiteral(long l)
Makes an exact, non-nullable literal of Bigint type
|
protected RexNode |
ReduceDecimalsRule.RexExpander.makeIsNegative(RexNode a) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeIsPositive(RexNode a) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeMinus(RexNode a,
RexNode b) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeMultiply(RexNode a,
RexNode b) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makePlus(RexNode a,
RexNode b) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeRoundFactor(int scale)
Makes an exact numeric value to be used for rounding.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.makeScaleFactor(int scale)
Makes an exact numeric literal to be used for scaling
|
protected RexNode |
ReduceDecimalsRule.RexExpander.scaleDown(RexNode value,
int scale)
Scales down a decimal value, and returns the scaled value as an exact
numeric.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.scaleDownDouble(RexNode value,
int scale)
Scales down a decimal value and returns the scaled value as a an
double precision approximate value.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.scaleUp(RexNode value,
int scale)
Scales up a decimal value and returns the scaled value as an exact
number.
|
RexNode |
ReduceDecimalsRule.DecimalShuttle.visitCall(RexCall call)
Rewrites a call in place, from bottom up, as follows:
visit operands
visit call node
rewrite call
visit the rewritten call
|
| Modifier and Type | Method and Description |
|---|---|
List<RexNode> |
MultiJoin.getChildExps() |
List<RexNode> |
LoptMultiJoin.getJoinFilters() |
List<RexNode> |
MultiJoin.getOuterJoinConditions() |
| Modifier and Type | Method and Description |
|---|---|
protected RexNode |
ReduceDecimalsRule.RexExpander.accessValue(RexNode node)
Retrieves the primitive value of a numeric node.
|
boolean |
FilterJoinRule.Predicate.apply(Join join,
JoinRelType joinType,
RexNode exp) |
boolean |
CalcRelSplitter.RelType.canImplement(RexNode expr,
boolean condition)
Returns whether this
RelType can implement a given
expression. |
RelNode |
PushProjector.convertProject(RexNode defaultExpr)
Decomposes a projection to the input references referenced by a
projection and a filter, either of which is optional.
|
RexNode |
PushProjector.convertRefsAndExprs(RexNode rex,
List<RelDataTypeField> destFields,
int[] adjustments)
Clones an expression tree and walks through it, adjusting each
RexInputRef index by some amount, and converting expressions that need to
be preserved to field references.
|
org.apache.calcite.rel.rules.LoptMultiJoin.Edge |
LoptMultiJoin.createEdge(RexNode condition) |
protected RexNode |
ReduceDecimalsRule.RexExpander.decodeValue(RexNode decimalNode)
Retrieves a decimal node's integer representation
|
protected RexNode |
ReduceDecimalsRule.RexExpander.encodeValue(RexNode value,
RelDataType decimalType)
Casts a decimal's integer representation to a decimal node.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.encodeValue(RexNode value,
RelDataType decimalType,
boolean checkOverflow)
Casts a decimal's integer representation to a decimal node.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.ensureScale(RexNode value,
int scale,
int required)
Ensures a value is of a required scale.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.ensureType(RelDataType type,
RexNode node)
Ensures expression is interpreted as a specified type.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.ensureType(RelDataType type,
RexNode node,
boolean matchNullability)
Ensures expression is interpreted as a specified type.
|
ImmutableBitSet |
LoptMultiJoin.getFactorsRefByJoinFilter(RexNode joinFilter) |
ImmutableBitSet |
LoptMultiJoin.getFieldsRefByJoinFilter(RexNode joinFilter) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeCase(RexNode condition,
RexNode thenClause,
RexNode elseClause) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeCase(RexNode whenA,
RexNode thenA,
RexNode whenB,
RexNode thenB,
RexNode elseClause) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeDivide(RexNode a,
RexNode b) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeIsNegative(RexNode a) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeIsPositive(RexNode a) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeMinus(RexNode a,
RexNode b) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makeMultiply(RexNode a,
RexNode b) |
protected RexNode |
ReduceDecimalsRule.RexExpander.makePlus(RexNode a,
RexNode b) |
protected RexNode |
ReduceDecimalsRule.RexExpander.scaleDown(RexNode value,
int scale)
Scales down a decimal value, and returns the scaled value as an exact
numeric.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.scaleDownDouble(RexNode value,
int scale)
Scales down a decimal value and returns the scaled value as a an
double precision approximate value.
|
protected RexNode |
ReduceDecimalsRule.RexExpander.scaleUp(RexNode value,
int scale)
Scales up a decimal value and returns the scaled value as an exact
number.
|
boolean |
PushProjector.ExprCondition.test(RexNode expr)
Evaluates a condition for a given expression.
|
boolean |
PushProjector.OperatorExprCondition.test(RexNode expr) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
ProjectRemoveRule.isIdentity(List<? extends RexNode> exps,
RelDataType childRowType) |
protected void |
FilterJoinRule.validateJoinFilters(List<RexNode> aboveFilters,
List<RexNode> joinFilters,
Join join,
JoinRelType joinType)
Validates that target execution framework can satisfy join filters.
|
protected void |
FilterJoinRule.validateJoinFilters(List<RexNode> aboveFilters,
List<RexNode> joinFilters,
Join join,
JoinRelType joinType)
Validates that target execution framework can satisfy join filters.
|
| Constructor and Description |
|---|
EquiJoin(RelOptCluster cluster,
RelTraitSet traits,
RelNode left,
RelNode right,
RexNode condition,
ImmutableIntList leftKeys,
ImmutableIntList rightKeys,
JoinRelType joinType,
Set<String> variablesStopped)
Deprecated.
|
MultiJoin(RelOptCluster cluster,
List<RelNode> inputs,
RexNode joinFilter,
RelDataType rowType,
boolean isFullOuterJoin,
List<RexNode> outerJoinConditions,
List<JoinRelType> joinTypes,
List<ImmutableBitSet> projFields,
com.google.common.collect.ImmutableMap<Integer,ImmutableIntList> joinFieldRefCountsMap,
RexNode postJoinFilter)
Constructs a MultiJoin.
|
PushProjector(LogicalProject origProj,
RexNode origFilter,
RelNode childRel,
PushProjector.ExprCondition preserveExprCondition)
Creates a PushProjector object for pushing projects past a RelNode.
|
| Constructor and Description |
|---|
MultiJoin(RelOptCluster cluster,
List<RelNode> inputs,
RexNode joinFilter,
RelDataType rowType,
boolean isFullOuterJoin,
List<RexNode> outerJoinConditions,
List<JoinRelType> joinTypes,
List<ImmutableBitSet> projFields,
com.google.common.collect.ImmutableMap<Integer,ImmutableIntList> joinFieldRefCountsMap,
RexNode postJoinFilter)
Constructs a MultiJoin.
|
| Modifier and Type | Class and Description |
|---|---|
class |
RexCall
An expression formed by a call to an operator with zero or more expressions
as operands.
|
class |
RexCorrelVariable
Reference to the current row of a correlating relational expression.
|
class |
RexDynamicParam
Dynamic parameter reference in a row-expression.
|
class |
RexFieldAccess
Access to a field of a row-expression.
|
class |
RexInputRef
Variable which references a field of an input relational expression.
|
class |
RexLiteral
Constant value in a row-expression.
|
class |
RexLocalRef
Local variable.
|
class |
RexOver
Call to an aggregate function over a window.
|
class |
RexRangeRef
Reference to a range of columns.
|
class |
RexSlot
Abstract base class for
RexInputRef and RexLocalRef. |
class |
RexVariable
A row-expression which references a field.
|
| Modifier and Type | Field and Description |
|---|---|
com.google.common.collect.ImmutableList<RexNode> |
RexCall.operands |
com.google.common.collect.ImmutableList<RexNode> |
RexWindow.partitionKeys |
| Modifier and Type | Method and Description |
|---|---|
<T extends RexNode> |
RexShuttle.apply(List<T> exprList)
Applies this shuttle to each expression in a list and returns the
resulting list.
|
static <T extends RexNode> |
RexUtil.apply(RexVisitor<T> shuttle,
T[] exprs)
Applies a shuttle to an array of expressions.
|
<T extends RexNode> |
RexShuttle.mutate(List<T> exprList)
Applies this shuttle to each expression in a list.
|
| Modifier and Type | Method and Description |
|---|---|
RexNode |
RexBuilder.addAggCall(AggregateCall aggCall,
int groupCount,
boolean indicator,
List<AggregateCall> aggCalls,
Map<AggregateCall,RexNode> aggCallMapping,
List<RelDataType> aggArgTypes)
Creates a reference to an aggregate call, checking for repeated calls.
|
static RexNode |
RexUtil.apply(Mappings.TargetMapping mapping,
RexNode node)
Applies a mapping to an expression.
|
RexNode |
RexShuttle.apply(RexNode expr)
Applies this shuttle to an expression, or returns null if the expression
is null.
|
static <T extends RexNode> |
RexUtil.apply(RexVisitor<T> shuttle,
T[] exprs)
Applies a shuttle to an array of expressions.
|
static RexNode |
RexUtil.composeConjunction(RexBuilder rexBuilder,
Iterable<? extends RexNode> nodes,
boolean nullOnEmpty)
Converts a collection of expressions into an AND.
|
static RexNode |
RexUtil.composeDisjunction(RexBuilder rexBuilder,
Iterable<? extends RexNode> nodes,
boolean nullOnEmpty)
Converts a collection of expressions into an OR.
|
RexNode |
RexBuilder.copy(RexNode expr)
Creates a copy of an expression, which may have been created using a
different RexBuilder and/or
RelDataTypeFactory, using this
RexBuilder. |
RexNode |
RexBuilder.decodeIntervalOrDecimal(RexNode node)
Retrieves an interval or decimal node's integer representation
|
RexNode |
RexBuilder.encodeIntervalOrDecimal(RexNode value,
RelDataType type,
boolean checkOverflow)
Casts a decimal's integer representation to a decimal node.
|
RexNode |
RexBuilder.ensureType(RelDataType type,
RexNode node,
boolean matchNullability)
Ensures expression is interpreted as a specified type.
|
RexNode |
RexProgram.expandLocalRef(RexLocalRef ref)
Fully expands a RexLocalRef back into a pure RexNode tree containing no
RexLocalRefs (reversing the effect of common subexpression elimination).
|
static RexNode |
RexUtil.flatten(RexBuilder rexBuilder,
RexNode node)
Flattens an expression.
|
RexNode |
RexProgram.gatherExpr(RexNode expr) |
RexNode |
RexWindowBound.getOffset()
Returns offset from XX PRECEDING/FOLLOWING.
|
RexNode |
RexFieldAccess.getReferenceExpr()
Returns the expression whose field is being accessed.
|
RexNode |
RexBuilder.makeAbstractCast(RelDataType type,
RexNode exp)
Creates a call to the CAST operator.
|
RexNode |
RexBuilder.makeCall(RelDataType returnType,
SqlOperator op,
List<RexNode> exprs)
Creates a call with a list of arguments and a predetermined type.
|
RexNode |
RexBuilder.makeCall(SqlOperator op,
List<? extends RexNode> exprs)
Creates a call with an array of arguments.
|
RexNode |
RexBuilder.makeCall(SqlOperator op,
RexNode... exprs)
Creates a call with a list of arguments.
|
RexNode |
RexBuilder.makeCast(RelDataType type,
RexNode exp)
Creates a call to the CAST operator, expanding if possible.
|
RexNode |
RexBuilder.makeCorrel(RelDataType type,
String name)
Creates an expression referencing a correlation variable.
|
RexNode |
RexBuilder.makeFieldAccess(RexNode expr,
int i)
Creates an expression accessing a field with a given ordinal from a
record.
|
RexNode |
RexBuilder.makeFieldAccess(RexNode expr,
String fieldName,
boolean caseSensitive)
Creates an expression accessing a given named field from a record.
|
RexNode |
RexBuilder.makeLiteral(Object value,
RelDataType type,
boolean allowCast)
Creates a literal of a given type.
|
RexNode |
RexBuilder.makeNewInvocation(RelDataType type,
List<RexNode> exprs)
Creates an invocation of the NEW operator.
|
RexNode |
RexBuilder.makeNotNullCast(RexNode expr)
Makes an expression which converts a value of type T to a value of type T
NOT NULL, or throws if the value is NULL.
|
RexNode |
RexBuilder.makeNullLiteral(SqlTypeName typeName)
Creates a literal whose value is NULL, with a particular type.
|
RexNode |
RexBuilder.makeNullLiteral(SqlTypeName typeName,
int precision)
Creates an expression corresponding to a null literal, cast to a specific
type and precision
|
RexNode |
RexBuilder.makeOver(RelDataType type,
SqlAggFunction operator,
List<RexNode> exprs,
List<RexNode> partitionKeys,
com.google.common.collect.ImmutableList<RexFieldCollation> orderKeys,
RexWindowBound lowerBound,
RexWindowBound upperBound,
boolean physical,
boolean allowPartial,
boolean nullWhenCountZero)
Creates a call to a windowed agg.
|
RexNode |
RexBuilder.makeRangeReference(RelNode input)
Creates a reference to all the fields in the row.
|
RexNode |
RexBuilder.makeReinterpretCast(RelDataType type,
RexNode exp,
RexNode checkOverflow)
Makes a reinterpret cast.
|
RexNode |
RexBuilder.makeZeroLiteral(RelDataType type)
Creates a literal of the default value for the given type.
|
static RexNode |
RexUtil.pullFactors(RexBuilder rexBuilder,
RexNode node)
Creates an equivalent version of a node where common factors among ORs
are pulled up.
|
static RexNode |
RexUtil.shift(RexNode node,
int offset)
Shifts every
RexInputRef in an expression by offset. |
static RexNode |
RexUtil.shift(RexNode node,
int start,
int offset)
|
static RexNode |
RexUtil.toCnf(RexBuilder rexBuilder,
RexNode rex)
Converts an expression to conjunctive normal form (CNF).
|
RexNode |
RexTransformer.transformNullSemantics() |
protected RexNode[] |
RexShuttle.visitArray(RexNode[] exprs,
boolean[] update)
Visits each of an array of expressions and returns an array of the
results.
|
RexNode |
RexShuttle.visitCall(RexCall call) |
RexNode |
RexPermuteInputsShuttle.visitCall(RexCall call) |
RexNode |
RexShuttle.visitCorrelVariable(RexCorrelVariable variable) |
RexNode |
RexShuttle.visitDynamicParam(RexDynamicParam dynamicParam) |
RexNode |
RexShuttle.visitFieldAccess(RexFieldAccess fieldAccess) |
RexNode |
RexShuttle.visitInputRef(RexInputRef inputRef) |
RexNode |
RexPermuteInputsShuttle.visitInputRef(RexInputRef local) |
RexNode |
RexShuttle.visitLiteral(RexLiteral literal) |
RexNode |
RexPermutationShuttle.visitLocalRef(RexLocalRef local) |
RexNode |
RexShuttle.visitLocalRef(RexLocalRef localRef) |
RexNode |
RexShuttle.visitOver(RexOver over) |
RexNode |
RexShuttle.visitRangeRef(RexRangeRef rangeRef) |
| Modifier and Type | Method and Description |
|---|---|
Iterable<RexNode> |
RexShuttle.apply(Iterable<? extends RexNode> iterable)
Applies this shuttle to each expression in an iterable.
|
static Iterable<RexNode> |
RexUtil.apply(Mappings.TargetMapping mapping,
Iterable<? extends RexNode> nodes)
Applies a mapping to an iterable over expressions.
|
static List<RexNode> |
RexUtil.fixUp(RexBuilder rexBuilder,
List<RexNode> nodes,
RelDataType rowType)
Fixes up the type of all
RexInputRefs in an
expression to match differences in nullability. |
static List<RexNode> |
RexUtil.flatten(List<? extends RexNode> exprs,
SqlOperator op)
Converts a list of operands into a list that is flat with respect to
the given operator.
|
static com.google.common.collect.ImmutableList<RexNode> |
RexUtil.flattenAnd(Iterable<? extends RexNode> nodes)
Flattens a list of AND nodes.
|
static com.google.common.collect.ImmutableList<RexNode> |
RexUtil.flattenOr(Iterable<? extends RexNode> nodes)
Flattens a list of OR nodes.
|
static List<RexNode> |
RexUtil.generateCastExpressions(RexBuilder rexBuilder,
RelDataType lhsRowType,
List<RexNode> rhsExps)
Generates a cast for a row type.
|
static List<RexNode> |
RexUtil.generateCastExpressions(RexBuilder rexBuilder,
RelDataType lhsRowType,
RelDataType rhsRowType)
Generates a cast from one row type to another
|
List<RexNode> |
RexProgram.getExprList()
Returns the common sub-expressions of this program.
|
List<RexNode> |
RexCall.getOperands() |
static Pair<RexNode,String> |
RexInputRef.of2(int index,
List<RelDataTypeField> fields)
Creates a reference to a given field in a list of fields.
|
static Iterable<RexNode> |
RexUtil.shift(Iterable<RexNode> nodes,
int offset)
Shifts every
RexInputRef in an expression by offset. |
Pair<com.google.common.collect.ImmutableList<RexNode>,com.google.common.collect.ImmutableList<RexNode>> |
RexProgram.split()
Splits this program into a list of project expressions and a list of
filter expressions.
|
Pair<com.google.common.collect.ImmutableList<RexNode>,com.google.common.collect.ImmutableList<RexNode>> |
RexProgram.split()
Splits this program into a list of project expressions and a list of
filter expressions.
|
protected List<RexNode> |
RexShuttle.visitList(List<? extends RexNode> exprs,
boolean[] update)
Visits each of a list of expressions and returns a list of the
results.
|
| Modifier and Type | Method and Description |
|---|---|
void |
RexProgramBuilder.addCondition(RexNode expr)
Sets the condition of the program.
|
RexLocalRef |
RexProgramBuilder.addExpr(RexNode expr)
Adds an expression to the list of common expressions, and returns a
reference to the expression.
|
RexLocalRef |
RexProgramBuilder.addProject(int at,
RexNode expr,
String name)
Adds a project expression to the program at a given position.
|
RexLocalRef |
RexProgramBuilder.addProject(RexNode expr,
String name)
Adds a project expression to the program.
|
static RexNode |
RexUtil.apply(Mappings.TargetMapping mapping,
RexNode node)
Applies a mapping to an expression.
|
RexNode |
RexShuttle.apply(RexNode expr)
Applies this shuttle to an expression, or returns null if the expression
is null.
|
static <T extends RexNode> |
RexUtil.apply(RexVisitor<T> shuttle,
T[] exprs)
Applies a shuttle to an array of expressions.
|
static void |
RexUtil.apply(RexVisitor<Void> visitor,
List<? extends RexNode> exprs,
RexNode expr)
Applies a visitor to a list of expressions and, if specified, a single
expression.
|
static void |
RexUtil.apply(RexVisitor<Void> visitor,
RexNode[] exprs,
RexNode expr)
Applies a visitor to an array of expressions and, if specified, a single
expression.
|
static void |
RexUtil.apply(RexVisitor<Void> visitor,
RexNode[] exprs,
RexNode expr)
Applies a visitor to an array of expressions and, if specified, a single
expression.
|
static boolean |
RexLiteral.booleanValue(RexNode node) |
static boolean |
RexUtil.containsFieldAccess(RexNode node)
Returns whether a given tree contains any
RexFieldAccess nodes. |
static boolean |
RexUtil.containsInputRef(RexNode node)
Returns whether a given tree contains any {link RexInputRef} nodes.
|
static boolean |
RexMultisetUtil.containsMixing(RexNode node)
Returns true if a node contains a mixing between multiset and
non-multiset calls.
|
static boolean |
RexMultisetUtil.containsMultiset(RexNode node,
boolean deep)
Returns true if node contains a multiset operator, otherwise false.
|
static boolean |
RexOver.containsOver(List<RexNode> exprs,
RexNode condition)
Returns whether an expression list contains an OVER clause.
|
static boolean |
RexOver.containsOver(RexNode expr)
Returns whether an expression contains an OVER clause.
|
SqlNode |
RexToSqlNodeConverterImpl.convertNode(RexNode node) |
SqlNode |
RexToSqlNodeConverter.convertNode(RexNode node)
|
RexNode |
RexBuilder.copy(RexNode expr)
Creates a copy of an expression, which may have been created using a
different RexBuilder and/or
RelDataTypeFactory, using this
RexBuilder. |
static RexProgram |
RexProgram.create(RelDataType inputRowType,
List<? extends RexNode> projectExprs,
RexNode conditionExpr,
List<String> fieldNames,
RexBuilder rexBuilder)
Creates a program which calculates projections and filters rows based
upon a condition.
|
static RexProgram |
RexProgram.create(RelDataType inputRowType,
List<? extends RexNode> projectExprs,
RexNode conditionExpr,
RelDataType outputRowType,
RexBuilder rexBuilder)
Creates a program which calculates projections and filters rows based
upon a condition.
|
static RexWindowBound |
RexWindowBound.create(SqlNode node,
RexNode rexNode)
Creates window bound.
|
RexNode |
RexBuilder.decodeIntervalOrDecimal(RexNode node)
Retrieves an interval or decimal node's integer representation
|
RexNode |
RexBuilder.encodeIntervalOrDecimal(RexNode value,
RelDataType type,
boolean checkOverflow)
Casts a decimal's integer representation to a decimal node.
|
RexNode |
RexBuilder.ensureType(RelDataType type,
RexNode node,
boolean matchNullability)
Ensures expression is interpreted as a specified type.
|
static RexCall |
RexMultisetUtil.findFirstMultiset(RexNode node,
boolean deep)
Returns a reference to the first found multiset call or null if none was
found
|
static RexCall |
RexUtil.findOperatorCall(SqlOperator operator,
RexNode node)
Returns whether a given node contains a RexCall with a specified operator
|
static RexNode |
RexUtil.flatten(RexBuilder rexBuilder,
RexNode node)
Flattens an expression.
|
RexNode |
RexProgram.gatherExpr(RexNode expr) |
static double |
RexUtil.getSelectivity(RexNode exp)
Returns a guess for the selectivity of an expression.
|
static int |
RexLiteral.intValue(RexNode node) |
static boolean |
RexUtil.isAtomic(RexNode expr) |
static boolean |
RexUtil.isCallTo(RexNode expr,
SqlOperator op)
|
boolean |
RexProgram.isConstant(RexNode ref)
Returns whether an expression is constant.
|
static boolean |
RexUtil.isFlat(RexNode expr)
Returns false if the expression can be optimized by flattening
calls to an associative operator such as AND and OR.
|
static boolean |
RexUtil.isNull(RexNode expr)
Returns whether a node represents the NULL value or a series of nested
CAST(NULL AS type) calls. |
boolean |
RexProgram.isNull(RexNode expr)
Returns whether an expression always evaluates to null.
|
static boolean |
RexUtil.isNullabilityCast(RelDataTypeFactory typeFactory,
RexNode node)
Returns whether an expression is a cast just for the purposes of
nullability, not changing any other aspect of the type.
|
static boolean |
RexLiteral.isNullLiteral(RexNode node) |
static boolean |
RexUtil.isNullLiteral(RexNode node,
boolean allowCast)
Returns whether a node represents the NULL value.
|
boolean |
RexChecker.isValid(RexNode expr)
Returns whether an expression is valid.
|
RexNode |
RexBuilder.makeAbstractCast(RelDataType type,
RexNode exp)
Creates a call to the CAST operator.
|
RexNode |
RexBuilder.makeCall(SqlOperator op,
RexNode... exprs)
Creates a call with a list of arguments.
|
RexNode |
RexBuilder.makeCast(RelDataType type,
RexNode exp)
Creates a call to the CAST operator, expanding if possible.
|
RexNode |
RexBuilder.makeFieldAccess(RexNode expr,
int i)
Creates an expression accessing a field with a given ordinal from a
record.
|
RexNode |
RexBuilder.makeFieldAccess(RexNode expr,
String fieldName,
boolean caseSensitive)
Creates an expression accessing a given named field from a record.
|
static Pair<String,String> |
RexUtil.makeKey(RexNode expr)
Creates a key for
RexNode which is the same as another key of
another RexNode only if the two have both the same type and textual
representation. |
RexNode |
RexBuilder.makeNotNullCast(RexNode expr)
Makes an expression which converts a value of type T to a value of type T
NOT NULL, or throws if the value is NULL.
|
RexNode |
RexBuilder.makeReinterpretCast(RelDataType type,
RexNode exp,
RexNode checkOverflow)
Makes a reinterpret cast.
|
void |
RexPattern.match(RexNode ptree,
RexAction action)
Calls
action for every combination of tokens for which this
pattern matches. |
RelDataType |
RexBuilder.matchNullability(RelDataType type,
RexNode value)
Ensures that a type's nullability matches a value's nullability.
|
void |
RexAction.onMatch(RexNode[] tokens) |
static RexNode |
RexUtil.pullFactors(RexBuilder rexBuilder,
RexNode node)
Creates an equivalent version of a node where common factors among ORs
are pulled up.
|
RexLocalRef |
RexProgramBuilder.registerInput(RexNode expr)
Registers an expression in the list of common sub-expressions, and
returns a reference to that expression.
|
RexLocalRef |
RexProgramBuilder.registerOutput(RexNode expr)
Converts an expression expressed in terms of the outputs of this
program into an expression expressed in terms of the inputs,
registers it in the list of common sub-expressions, and returns a
reference to that expression.
|
static boolean |
RexUtil.requiresDecimalExpansion(RexNode expr,
boolean recurse)
Determines whether a
RexCall requires decimal expansion. |
static RexNode |
RexUtil.shift(RexNode node,
int offset)
Shifts every
RexInputRef in an expression by offset. |
static RexNode |
RexUtil.shift(RexNode node,
int start,
int offset)
|
static String |
RexLiteral.stringValue(RexNode node) |
static RexNode |
RexUtil.toCnf(RexBuilder rexBuilder,
RexNode rex)
Converts an expression to conjunctive normal form (CNF).
|
protected RexNode[] |
RexShuttle.visitArray(RexNode[] exprs,
boolean[] update)
Visits each of an array of expressions and returns an array of the
results.
|
| Modifier and Type | Method and Description |
|---|---|
RexNode |
RexBuilder.addAggCall(AggregateCall aggCall,
int groupCount,
boolean indicator,
List<AggregateCall> aggCalls,
Map<AggregateCall,RexNode> aggCallMapping,
List<RelDataType> aggArgTypes)
Creates a reference to an aggregate call, checking for repeated calls.
|
Iterable<RexNode> |
RexShuttle.apply(Iterable<? extends RexNode> iterable)
Applies this shuttle to each expression in an iterable.
|
static Iterable<RexNode> |
RexUtil.apply(Mappings.TargetMapping mapping,
Iterable<? extends RexNode> nodes)
Applies a mapping to an iterable over expressions.
|
static void |
RexUtil.apply(RexVisitor<Void> visitor,
List<? extends RexNode> exprs,
RexNode expr)
Applies a visitor to a list of expressions and, if specified, a single
expression.
|
RexCall |
RexCall.clone(RelDataType type,
List<RexNode> operands)
Creates a new call to the same operator with different operands.
|
RexCall |
RexOver.clone(RelDataType type,
List<RexNode> operands) |
static boolean |
RexUtil.compatibleTypes(List<RexNode> exprs,
RelDataType type,
boolean fail)
Returns whether the type of an array of expressions is compatible with a
struct type.
|
static RexNode |
RexUtil.composeConjunction(RexBuilder rexBuilder,
Iterable<? extends RexNode> nodes,
boolean nullOnEmpty)
Converts a collection of expressions into an AND.
|
static RexNode |
RexUtil.composeDisjunction(RexBuilder rexBuilder,
Iterable<? extends RexNode> nodes,
boolean nullOnEmpty)
Converts a collection of expressions into an OR.
|
static boolean |
RexUtil.containCommonExprs(List<RexNode> exprs,
boolean fail)
Returns whether an array of expressions has any common sub-expressions.
|
static boolean |
RexUtil.containComplexExprs(List<RexNode> exprs)
Returns whether a list of expressions contains complex expressions, that
is, a call whose arguments are not
RexVariable (or a subtype such
as RexInputRef) or RexLiteral. |
static boolean |
RexUtil.containForwardRefs(List<RexNode> exprs,
RelDataType inputRowType,
boolean fail)
Returns whether an array of expressions contains a forward reference.
|
static boolean |
RexUtil.containIdentity(List<? extends RexNode> exprs,
RelDataType rowType,
boolean fail)
Returns whether the leading edge of a given array of expressions is
wholly
RexInputRef objects with types corresponding to the
underlying datatype. |
static boolean |
RexMultisetUtil.containsMultiset(List<RexNode> nodes,
boolean deep)
Returns whether a list of expressions contains a multiset.
|
static boolean |
RexOver.containsOver(List<RexNode> exprs,
RexNode condition)
Returns whether an expression list contains an OVER clause.
|
static RexProgram |
RexProgram.create(RelDataType inputRowType,
List<? extends RexNode> projectExprs,
RexNode conditionExpr,
List<String> fieldNames,
RexBuilder rexBuilder)
Creates a program which calculates projections and filters rows based
upon a condition.
|
static RexProgram |
RexProgram.create(RelDataType inputRowType,
List<? extends RexNode> projectExprs,
RexNode conditionExpr,
RelDataType outputRowType,
RexBuilder rexBuilder)
Creates a program which calculates projections and filters rows based
upon a condition.
|
static RexProgramBuilder |
RexProgramBuilder.create(RexBuilder rexBuilder,
RelDataType inputRowType,
List<RexNode> exprList,
List<RexLocalRef> projectRefList,
RexLocalRef conditionRef,
RelDataType outputRowType,
boolean normalize)
Creates a program builder with the same contents as a program.
|
static RexProgramBuilder |
RexProgramBuilder.create(RexBuilder rexBuilder,
RelDataType inputRowType,
List<RexNode> exprList,
List<RexLocalRef> projectRefList,
RexLocalRef conditionRef,
RelDataType outputRowType,
RexShuttle shuttle,
boolean updateRefs)
Creates a program builder with the same contents as a program, applying a
shuttle first.
|
static RelDataType |
RexUtil.createStructType(RelDataTypeFactory typeFactory,
List<? extends RexNode> exprs,
List<String> names)
Creates a record type with specified field names.
|
static RelDataType |
RexUtil.createStructType(RelDataTypeFactory typeFactory,
List<RexNode> exprs)
Creates a record type with anonymous field names.
|
RelDataType |
RexBuilder.deriveReturnType(SqlOperator op,
List<? extends RexNode> exprs)
Derives the return type of a call to an operator.
|
static List<RexNode> |
RexUtil.fixUp(RexBuilder rexBuilder,
List<RexNode> nodes,
RelDataType rowType)
Fixes up the type of all
RexInputRefs in an
expression to match differences in nullability. |
static List<RexNode> |
RexUtil.flatten(List<? extends RexNode> exprs,
SqlOperator op)
Converts a list of operands into a list that is flat with respect to
the given operator.
|
static com.google.common.collect.ImmutableList<RexNode> |
RexUtil.flattenAnd(Iterable<? extends RexNode> nodes)
Flattens a list of AND nodes.
|
static com.google.common.collect.ImmutableList<RexNode> |
RexUtil.flattenOr(Iterable<? extends RexNode> nodes)
Flattens a list of OR nodes.
|
static List<RexNode> |
RexUtil.generateCastExpressions(RexBuilder rexBuilder,
RelDataType lhsRowType,
List<RexNode> rhsExps)
Generates a cast for a row type.
|
RexExecutable |
RexExecutorImpl.getExecutable(RexBuilder rexBuilder,
List<RexNode> exps,
RelDataType rowType)
Creates an
RexExecutable that allows to apply the
generated code during query processing (filter, projection). |
RexNode |
RexBuilder.makeCall(RelDataType returnType,
SqlOperator op,
List<RexNode> exprs)
Creates a call with a list of arguments and a predetermined type.
|
RexNode |
RexBuilder.makeCall(SqlOperator op,
List<? extends RexNode> exprs)
Creates a call with an array of arguments.
|
RexNode |
RexBuilder.makeNewInvocation(RelDataType type,
List<RexNode> exprs)
Creates an invocation of the NEW operator.
|
RexNode |
RexBuilder.makeOver(RelDataType type,
SqlAggFunction operator,
List<RexNode> exprs,
List<RexNode> partitionKeys,
com.google.common.collect.ImmutableList<RexFieldCollation> orderKeys,
RexWindowBound lowerBound,
RexWindowBound upperBound,
boolean physical,
boolean allowPartial,
boolean nullWhenCountZero)
Creates a call to a windowed agg.
|
RexNode |
RexBuilder.makeOver(RelDataType type,
SqlAggFunction operator,
List<RexNode> exprs,
List<RexNode> partitionKeys,
com.google.common.collect.ImmutableList<RexFieldCollation> orderKeys,
RexWindowBound lowerBound,
RexWindowBound upperBound,
boolean physical,
boolean allowPartial,
boolean nullWhenCountZero)
Creates a call to a windowed agg.
|
RexWindow |
RexBuilder.makeWindow(List<RexNode> partitionKeys,
com.google.common.collect.ImmutableList<RexFieldCollation> orderKeys,
RexWindowBound lowerBound,
RexWindowBound upperBound,
boolean isRows)
Creates a window specification.
|
void |
RexExecutable.reduce(RexBuilder rexBuilder,
List<RexNode> constExps,
List<RexNode> reducedValues) |
void |
RexExecutable.reduce(RexBuilder rexBuilder,
List<RexNode> constExps,
List<RexNode> reducedValues) |
void |
RexExecutorImpl.reduce(RexBuilder rexBuilder,
List<RexNode> constExps,
List<RexNode> reducedValues)
Do constant reduction using generated code.
|
void |
RexExecutorImpl.reduce(RexBuilder rexBuilder,
List<RexNode> constExps,
List<RexNode> reducedValues)
Do constant reduction using generated code.
|
static boolean |
RexUtil.requiresDecimalExpansion(List<RexNode> operands,
boolean recurse)
Determines whether any operand of a set requires decimal expansion
|
static Iterable<RexNode> |
RexUtil.shift(Iterable<RexNode> nodes,
int offset)
Shifts every
RexInputRef in an expression by offset. |
static List<RelDataType> |
RexUtil.types(List<? extends RexNode> nodes)
Transforms a list of expressions into a list of their types.
|
static boolean |
RexVisitorImpl.visitArrayAnd(RexVisitor<Boolean> visitor,
List<RexNode> exprs)
Visits an array of expressions, returning the logical 'and' of their
results.
|
static boolean |
RexVisitorImpl.visitArrayOr(RexVisitor<Boolean> visitor,
List<RexNode> exprs)
Visits an array of expressions, returning the logical 'or' of their
results.
|
protected List<RexNode> |
RexShuttle.visitList(List<? extends RexNode> exprs,
boolean[] update)
Visits each of a list of expressions and returns a list of the
results.
|
void |
RexShuttle.visitList(List<? extends RexNode> exprs,
List<RexNode> outExprs)
Visits a list and writes the results to another list.
|
void |
RexShuttle.visitList(List<? extends RexNode> exprs,
List<RexNode> outExprs)
Visits a list and writes the results to another list.
|
| Constructor and Description |
|---|
RexFieldCollation(RexNode left,
Set<SqlKind> right) |
RexTransformer(RexNode root,
RexBuilder rexBuilder) |
| Constructor and Description |
|---|
RexCall(RelDataType type,
SqlOperator op,
List<? extends RexNode> operands) |
RexCallBinding(RelDataTypeFactory typeFactory,
SqlOperator sqlOperator,
List<? extends RexNode> operands) |
RexProgram(RelDataType inputRowType,
List<? extends RexNode> exprs,
List<RexLocalRef> projects,
RexLocalRef condition,
RelDataType outputRowType)
Creates a program.
|
| Modifier and Type | Method and Description |
|---|---|
Enumerable<Object[]> |
FilterableTable.scan(DataContext root,
List<RexNode> filters)
Returns an enumerator over the rows in this Table.
|
Enumerable<Object[]> |
ProjectableFilterableTable.scan(DataContext root,
List<RexNode> filters,
int[] projects)
Returns an enumerable over the rows in this Table.
|
| Modifier and Type | Method and Description |
|---|---|
protected RexNode |
SqlToRelConverter.adjustInputRef(SqlToRelConverter.Blackboard bb,
RexInputRef inputRef)
Adjusts the type of a reference to an input field to account for nulls
introduced by outer joins; and adjusts the offset to match the physical
implementation.
|
RexNode |
StandardConvertletTable.castToValidatedType(SqlRexContext cx,
SqlCall call,
RexNode value)
Casts a RexNode value to the validated type of a SqlCall.
|
RexNode |
StandardConvertletTable.convertAggregateFunction(SqlRexContext cx,
SqlAggFunction fun,
SqlCall call) |
RexNode |
StandardConvertletTable.convertArray(SqlRexContext cx,
SqlArrayValueConstructor op,
SqlCall call) |
RexNode |
StandardConvertletTable.convertBetween(SqlRexContext cx,
SqlBetweenOperator op,
SqlCall call)
Converts a BETWEEN expression.
|
RexNode |
SqlNodeToRexConverter.convertCall(SqlRexContext cx,
SqlCall call)
|
RexNode |
StandardConvertletTable.convertCall(SqlRexContext cx,
SqlCall call)
Converts a call to an operator into a
RexCall to the same
operator. |
RexNode |
SqlRexConvertlet.convertCall(SqlRexContext cx,
SqlCall call) |
RexNode |
SqlNodeToRexConverterImpl.convertCall(SqlRexContext cx,
SqlCall call) |
RexNode |
StandardConvertletTable.convertCase(SqlRexContext cx,
SqlCase call)
Converts a CASE expression.
|
protected RexNode |
StandardConvertletTable.convertCast(SqlRexContext cx,
SqlCall call) |
RexNode |
StandardConvertletTable.convertDatetimeMinus(SqlRexContext cx,
SqlDatetimeSubtractionOperator op,
SqlCall call) |
RexNode |
SqlRexContext.convertExpression(SqlNode expr)
|
RexNode |
SqlToRelConverter.convertExpression(SqlNode node)
|
RexNode |
SqlToRelConverter.Blackboard.convertExpression(SqlNode expr) |
RexNode |
SqlToRelConverter.convertExpression(SqlNode node,
Map<String,RexNode> nameToNodeMap)
|
protected RexNode |
SqlToRelConverter.convertExtendedExpression(SqlNode node,
SqlToRelConverter.Blackboard bb)
Converts a non-standard expression.
|
RexNode |
StandardConvertletTable.convertExtract(SqlRexContext cx,
SqlExtractFunction op,
SqlCall call) |
protected RexNode |
StandardConvertletTable.convertFloorCeil(SqlRexContext cx,
SqlCall call,
boolean floor) |
RexNode |
StandardConvertletTable.convertFunction(SqlRexContext cx,
SqlFunction fun,
SqlCall call) |
RexNode |
SqlToRelConverter.Blackboard.convertInterval(SqlIntervalQualifier intervalQualifier) |
RexNode |
StandardConvertletTable.convertJdbc(SqlRexContext cx,
SqlJdbcFunctionCall op,
SqlCall call) |
RexNode |
SqlRexContext.convertLiteral(SqlLiteral literal)
Converts a literal.
|
RexNode |
SqlToRelConverter.Blackboard.convertLiteral(SqlLiteral literal) |
RexNode |
SqlNodeToRexConverter.convertLiteral(SqlRexContext cx,
SqlLiteral literal)
Converts a
SQL literal to a
REX literal. |
RexNode |
SqlNodeToRexConverterImpl.convertLiteral(SqlRexContext cx,
SqlLiteral literal) |
RexNode |
StandardConvertletTable.convertLiteralChain(SqlRexContext cx,
SqlLiteralChainOperator op,
SqlCall call)
Converts a LiteralChain expression: that is, concatenates the operands
immediately, to produce a single literal string.
|
RexNode |
StandardConvertletTable.convertMap(SqlRexContext cx,
SqlMapValueConstructor op,
SqlCall call) |
RexNode |
StandardConvertletTable.convertMultiset(SqlRexContext cx,
SqlMultisetValueConstructor op,
SqlCall call) |
RexNode |
StandardConvertletTable.convertMultisetQuery(SqlRexContext cx,
SqlMultisetQueryConstructor op,
SqlCall call) |
RexNode |
StandardConvertletTable.convertOverlaps(SqlRexContext cx,
SqlOverlapsOperator op,
SqlCall call)
Converts a call to OVERLAPS.
|
RexNode |
StandardConvertletTable.convertQuarter(SqlRexContext cx,
SqlQuarterFunction op,
SqlCall call)
Converts a call to the
QUARTER function. |
RexNode |
StandardConvertletTable.convertRow(SqlRexContext cx,
SqlRowOperator op,
SqlCall call)
Converts a ROW.
|
RexNode |
StandardConvertletTable.convertSequenceValue(SqlRexContext cx,
SqlSequenceValueOperator fun,
SqlCall call) |
RexNode |
SqlToRelConverter.Blackboard.convertSortExpression(SqlNode expr,
Set<SqlKind> flags)
Converts an item in an ORDER BY clause, extracting DESC, NULLS LAST
and NULLS FIRST flags first.
|
RexNode |
SubqueryConverter.convertSubquery(SqlCall subquery,
SqlToRelConverter parentConverter,
boolean isExists,
boolean isExplain)
Converts the subquery to an equivalent expression.
|
protected RexNode |
RelDecorrelator.decorrelateExpr(RexNode exp) |
RexNode |
SqlToRelConverter.AggConverter.lookupAggregates(SqlCall call) |
RexNode |
DefaultValueFactory.newAttributeInitializer(RelDataType type,
SqlFunction constructor,
int iAttribute,
List<RexNode> constructorArgs)
Creates an expression which evaluates to the initializer expression for a
particular attribute of a structured type.
|
RexNode |
DefaultValueFactory.newColumnDefaultValue(RelOptTable table,
int iColumn)
Creates an expression which evaluates to the default value for a
particular column.
|
RexNode |
SqlToRelConverter.Blackboard.register(RelNode rel,
JoinRelType joinType) |
RexNode |
SqlToRelConverter.Blackboard.register(RelNode rel,
JoinRelType joinType,
List<RexNode> leftKeys)
Registers a relational expression.
|
protected RexNode |
RelDecorrelator.removeCorrelationExpr(RexNode exp,
boolean projectPulledAboveLeftCorrelator) |
protected RexNode |
RelDecorrelator.removeCorrelationExpr(RexNode exp,
boolean projectPulledAboveLeftCorrelator,
RexInputRef nullIndicator) |
protected RexNode |
RelDecorrelator.removeCorrelationExpr(RexNode exp,
boolean projectPulledAboveLeftCorrelator,
Set<Integer> isCount) |
RexNode |
SqlToRelConverter.Blackboard.visit(SqlCall call) |
RexNode |
SqlToRelConverter.Blackboard.visit(SqlDataTypeSpec type) |
RexNode |
SqlToRelConverter.Blackboard.visit(SqlDynamicParam param) |
RexNode |
SqlToRelConverter.Blackboard.visit(SqlIdentifier id) |
RexNode |
SqlToRelConverter.Blackboard.visit(SqlIntervalQualifier intervalQualifier) |
RexNode |
SqlToRelConverter.Blackboard.visit(SqlLiteral literal) |
RexNode |
SqlToRelConverter.Blackboard.visit(SqlNodeList nodeList) |
| Modifier and Type | Method and Description |
|---|---|
Map<SqlNode,RexNode> |
SqlToRelConverter.getMapConvertedNonCorrSubqs() |
List<RexNode> |
SqlToRelConverter.AggConverter.getPreExprs() |
| Modifier and Type | Method and Description |
|---|---|
RexNode |
StandardConvertletTable.castToValidatedType(SqlRexContext cx,
SqlCall call,
RexNode value)
Casts a RexNode value to the validated type of a SqlCall.
|
protected void |
SqlToRelConverter.collectInsertTargets(SqlInsert call,
RexNode sourceRef,
List<String> targetColumnNames,
List<RexNode> columnExprs)
Given an INSERT statement, collects the list of names to be populated and
the expressions to put in them.
|
protected RelNode |
SqlToRelConverter.createJoin(RelNode left,
RelNode right,
RexNode condition,
JoinRelType joinType,
Set<String> variablesStopped)
Factory method that creates a join.
|
protected RelNode |
SqlToRelConverter.createJoin(SqlToRelConverter.Blackboard bb,
RelNode leftRel,
RelNode rightRel,
RexNode joinCond,
JoinRelType joinType) |
protected RexNode |
RelDecorrelator.decorrelateExpr(RexNode exp) |
protected RexNode |
RelDecorrelator.removeCorrelationExpr(RexNode exp,
boolean projectPulledAboveLeftCorrelator) |
protected RexNode |
RelDecorrelator.removeCorrelationExpr(RexNode exp,
boolean projectPulledAboveLeftCorrelator,
RexInputRef nullIndicator) |
protected RexNode |
RelDecorrelator.removeCorrelationExpr(RexNode exp,
boolean projectPulledAboveLeftCorrelator,
Set<Integer> isCount) |
| Modifier and Type | Method and Description |
|---|---|
void |
SqlToRelConverter.addConvertedNonCorrSubqs(Map<SqlNode,RexNode> alreadyConvertedNonCorrSubqs)
Adds to the current map of non-correlated converted subqueries the
elements from another map that contains non-correlated subqueries that
have been converted by another SqlToRelConverter.
|
protected void |
SqlToRelConverter.collectInsertTargets(SqlInsert call,
RexNode sourceRef,
List<String> targetColumnNames,
List<RexNode> columnExprs)
Given an INSERT statement, collects the list of names to be populated and
the expressions to put in them.
|
RexNode |
SqlToRelConverter.convertExpression(SqlNode node,
Map<String,RexNode> nameToNodeMap)
|
protected SqlToRelConverter.Blackboard |
SqlToRelConverter.createBlackboard(SqlValidatorScope scope,
Map<String,RexNode> nameToNodeMap)
Factory method for creating translation workspace.
|
protected void |
SqlToRelConverter.extraSelectItems(SqlToRelConverter.Blackboard bb,
SqlSelect select,
List<RexNode> exprList,
List<String> nameList,
Collection<String> aliasList,
List<SqlMonotonicity> columnMonotonicityList)
Adds extra select items.
|
RexNode |
DefaultValueFactory.newAttributeInitializer(RelDataType type,
SqlFunction constructor,
int iAttribute,
List<RexNode> constructorArgs)
Creates an expression which evaluates to the initializer expression for a
particular attribute of a structured type.
|
RexNode |
SqlToRelConverter.Blackboard.register(RelNode rel,
JoinRelType joinType,
List<RexNode> leftKeys)
Registers a relational expression.
|
| Constructor and Description |
|---|
SqlToRelConverter.Blackboard(SqlValidatorScope scope,
Map<String,RexNode> nameToNodeMap)
Creates a Blackboard.
|
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.