public abstract class SubQueryRemoveRule extends RelOptRule
Sub-queries are represented by RexSubQuery expressions.
A sub-query may or may not be correlated. If a sub-query is correlated,
the wrapped RelNode will contain a RexCorrelVariable before
the rewrite, and the product of the rewrite will be a Correlate.
The Correlate can be removed using RelDecorrelator.
| Modifier and Type | Class and Description |
|---|---|
private static class |
SubQueryRemoveRule.ReplaceSubQueryShuttle
Shuttle that replaces occurrences of a given
RexSubQuery with a replacement
expression. |
| Modifier and Type | Field and Description |
|---|---|
static SubQueryRemoveRule |
FILTER |
static SubQueryRemoveRule |
JOIN |
static SubQueryRemoveRule |
PROJECT |
description, operands, relBuilderFactory| Constructor and Description |
|---|
SubQueryRemoveRule(RelOptRuleOperand operand,
RelBuilderFactory relBuilderFactory,
String description)
Creates a SubQueryRemoveRule.
|
| Modifier and Type | Method and Description |
|---|---|
protected RexNode |
apply(RexSubQuery e,
Set<CorrelationId> variablesSet,
RelOptUtil.Logic logic,
RelBuilder builder,
int inputCount,
int offset) |
private RexInputRef |
field(RelBuilder builder,
int inputCount,
int offset)
Returns a reference to a particular field, by offset, across several
inputs on a
RelBuilder's stack. |
private static List<RexNode> |
fields(RelBuilder builder,
int fieldCount)
Returns a list of expressions that project the first
fieldCount
fields of the top input on a RelBuilder's stack. |
any, convert, convert, convertList, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, onMatch, operand, operand, operand, operand, operand, some, toString, unorderedpublic static final SubQueryRemoveRule PROJECT
public static final SubQueryRemoveRule FILTER
public static final SubQueryRemoveRule JOIN
public SubQueryRemoveRule(RelOptRuleOperand operand, RelBuilderFactory relBuilderFactory, String description)
operand - root operand, must not be nulldescription - Description, or null to guess descriptionrelBuilderFactory - Builder for relational expressionsprotected RexNode apply(RexSubQuery e, Set<CorrelationId> variablesSet, RelOptUtil.Logic logic, RelBuilder builder, int inputCount, int offset)
private RexInputRef field(RelBuilder builder, int inputCount, int offset)
RelBuilder's stack.private static List<RexNode> fields(RelBuilder builder, int fieldCount)
fieldCount
fields of the top input on a RelBuilder's stack.Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.