@API(since="1.27",
status=EXPERIMENTAL)
public final class CorrelateProjectExtractor
extends RelHomogeneousShuttle
Project, with a "simple"
computation over the correlated variables, from the right side of a correlation
(Correlate) and places it on the left side.
Plan before
LogicalCorrelate(correlation=[$cor0], joinType=[left], requiredColumns=[{7}])
LogicalTableScan(table=[[scott, EMP]])
LogicalFilter(condition=[=($0, +(10, $cor0.DEPTNO))])
LogicalTableScan(table=[[scott, DEPT]])
Plan after
LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3],... DNAME=[$10], LOC=[$11])
LogicalCorrelate(correlation=[$cor0], joinType=[left], requiredColumns=[{8}])
LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], ... COMM=[$6], DEPTNO=[$7], $f8=[+(10, $7)])
LogicalTableScan(table=[[scott, EMP]])
LogicalFilter(condition=[=($0, $cor0.$f8)])
LogicalTableScan(table=[[scott, DEPT]])
Essentially this transformation moves the computation over a correlated expression from the inner loop to the outer loop. It materializes the computation on the left side and flattens expressions on correlated variables on the right side.
stack| Constructor and Description |
|---|
CorrelateProjectExtractor(RelBuilderFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
RelNode |
visit(LogicalCorrelate correlate) |
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitvisit, visitChild, visitChildrenpublic CorrelateProjectExtractor(RelBuilderFactory factory)
public RelNode visit(LogicalCorrelate correlate)
visit in interface RelShuttlevisit in class RelHomogeneousShuttleCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.