public class SubQueryDecorrelator
extends org.apache.calcite.rel.RelShuttleImpl
The Basic idea of SubQueryDecorrelator is from RelDecorrelator
, however there are differences between them: 1. This
class works with RexSubQuery
, while RelDecorrelator works with LogicalCorrelate
.
2. This class will get an equivalent non-correlated expressions tree and correlation conditions,
while RelDecorrelator will replace all correlated expressions with non-correlated expressions
that are produced from joining the RelNode. 3. This class supports both equi and non-equi
correlation conditions, while RelDecorrelator only supports equi correlation conditions.
Modifier and Type | Class and Description |
---|---|
static class |
SubQueryDecorrelator.Result
Result describing the relational expression after decorrelation and where to find the
equivalent non-correlated expressions and correlated conditions.
|
static class |
SubQueryDecorrelator.SubQueryRelDecorrelator
Pull out all correlation conditions from a given subquery to top level, and rebuild the
subquery rel tree without correlation conditions.
|
Modifier and Type | Method and Description |
---|---|
static SubQueryDecorrelator.Result |
decorrelateQuery(org.apache.calcite.rel.RelNode rootRel)
Decorrelates a subquery.
|
org.apache.calcite.rel.RelNode |
visit(org.apache.calcite.rel.logical.LogicalFilter filter) |
protected org.apache.calcite.rel.RelNode |
visitChild(org.apache.calcite.rel.RelNode parent,
int i,
org.apache.calcite.rel.RelNode input) |
public static SubQueryDecorrelator.Result decorrelateQuery(org.apache.calcite.rel.RelNode rootRel)
This is the main entry point to SubQueryDecorrelator
.
rootRel
- The node which has SubQuery.protected org.apache.calcite.rel.RelNode visitChild(org.apache.calcite.rel.RelNode parent, int i, org.apache.calcite.rel.RelNode input)
visitChild
in class org.apache.calcite.rel.RelShuttleImpl
public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.logical.LogicalFilter filter)
visit
in interface org.apache.calcite.rel.RelShuttle
visit
in class org.apache.calcite.rel.RelShuttleImpl
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.