public class DrillPushProjectIntoScanRule
extends org.apache.calcite.plan.RelOptRule
Modifier and Type | Field and Description |
---|---|
static org.apache.calcite.plan.RelOptRule |
DRILL_LOGICAL_INSTANCE |
static org.apache.calcite.plan.RelOptRule |
DRILL_PHYSICAL_INSTANCE |
static org.apache.calcite.plan.RelOptRule |
INSTANCE |
Constructor and Description |
---|
DrillPushProjectIntoScanRule(Class<? extends org.apache.calcite.rel.core.Project> projectClass,
Class<? extends org.apache.calcite.rel.core.TableScan> scanClass,
String description) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canPushProjectIntoScan(org.apache.calcite.plan.RelOptTable table,
DrillRelOptUtil.ProjectPushInfo projectPushInfo)
Push project into scan be done only if this is not a star query and
table supports project push down.
|
protected org.apache.calcite.rel.core.Project |
createProject(org.apache.calcite.rel.core.Project project,
org.apache.calcite.rel.core.TableScan newScan,
List<org.apache.calcite.rex.RexNode> newProjects)
Creates new
DrillProjectRelBase instance with specified TableScan newScan child
and List<RexNode> newProjects expressions using specified Project project as prototype. |
protected org.apache.calcite.rel.core.TableScan |
createScan(org.apache.calcite.rel.core.TableScan scan,
DrillRelOptUtil.ProjectPushInfo projectPushInfo)
Creates new
DrillScanRelBase instance with row type and fields list
obtained from specified ProjectPushInfo projectPushInfo
using specified TableScan scan as prototype. |
void |
onMatch(org.apache.calcite.plan.RelOptRuleCall call) |
protected boolean |
skipScanConversion(org.apache.calcite.rel.type.RelDataType projectRelDataType,
org.apache.calcite.rel.core.TableScan scan)
Checks whether conversion of input
TableScan instance to target
TableScan may be omitted. |
any, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unordered
public static final org.apache.calcite.plan.RelOptRule INSTANCE
public static final org.apache.calcite.plan.RelOptRule DRILL_LOGICAL_INSTANCE
public static final org.apache.calcite.plan.RelOptRule DRILL_PHYSICAL_INSTANCE
public void onMatch(org.apache.calcite.plan.RelOptRuleCall call)
onMatch
in class org.apache.calcite.plan.RelOptRule
protected boolean skipScanConversion(org.apache.calcite.rel.type.RelDataType projectRelDataType, org.apache.calcite.rel.core.TableScan scan)
TableScan
instance to target
TableScan
may be omitted.projectRelDataType
- project rel data typescan
- TableScan to be checkedTableScan
has the same row type as specified.protected org.apache.calcite.rel.core.Project createProject(org.apache.calcite.rel.core.Project project, org.apache.calcite.rel.core.TableScan newScan, List<org.apache.calcite.rex.RexNode> newProjects)
DrillProjectRelBase
instance with specified TableScan newScan
child
and List<RexNode> newProjects
expressions using specified Project project
as prototype.project
- the prototype of resulting projectnewScan
- new project childnewProjects
- new project expressionsprotected org.apache.calcite.rel.core.TableScan createScan(org.apache.calcite.rel.core.TableScan scan, DrillRelOptUtil.ProjectPushInfo projectPushInfo)
DrillScanRelBase
instance with row type and fields list
obtained from specified ProjectPushInfo projectPushInfo
using specified TableScan scan
as prototype.scan
- the prototype of resulting scanprojectPushInfo
- the source of row type and fields listprotected boolean canPushProjectIntoScan(org.apache.calcite.plan.RelOptTable table, DrillRelOptUtil.ProjectPushInfo projectPushInfo) throws IOException
table
- table instanceprojectPushInfo
- fields informationIOException
Copyright © 1970 The Apache Software Foundation. All rights reserved.