OmniSciDB  04ee39c94c
com.mapd.calcite.parser.ProjectProjectRemoveRule Class Reference
+ Inheritance diagram for com.mapd.calcite.parser.ProjectProjectRemoveRule:
+ Collaboration diagram for com.mapd.calcite.parser.ProjectProjectRemoveRule:

Public Member Functions

 ProjectProjectRemoveRule (RelBuilderFactory relBuilderFactory)
 
void onMatch (RelOptRuleCall call)
 

Static Public Attributes

static final ProjectProjectRemoveRule INSTANCE
 

Static Package Functions

static RelNode unwrap (RelNode node)
 

Private Attributes

ProjectRemoveRule innerRule
 

Detailed Description

removes identical projection nodes, if they are not the outer most projection or if the child is a projection

Definition at line 32 of file ProjectProjectRemoveRule.java.

Constructor & Destructor Documentation

◆ ProjectProjectRemoveRule()

com.mapd.calcite.parser.ProjectProjectRemoveRule.ProjectProjectRemoveRule ( RelBuilderFactory  relBuilderFactory)
inline

Creates a ProjectRemoveRule.

Parameters
relBuilderFactoryBuilder for relational expressions

Definition at line 51 of file ProjectProjectRemoveRule.java.

51  {
52  super(operandJ(Project.class, null, ProjectRemoveRule::isTrivial, any()),
53  relBuilderFactory,
54  null);
55  innerRule = new ProjectRemoveRule(relBuilderFactory);
56  }

Member Function Documentation

◆ onMatch()

void com.mapd.calcite.parser.ProjectProjectRemoveRule.onMatch ( RelOptRuleCall  call)
inline

Definition at line 59 of file ProjectProjectRemoveRule.java.

References com.mapd.calcite.parser.ProjectProjectRemoveRule.unwrap().

59  {
60  boolean hasParents = null != call.getParents() && !call.getParents().isEmpty();
61  Project project = (Project) call.rel(0);
62  boolean inputIsProject = unwrap(project.getInput()) instanceof Project;
63  if (hasParents || inputIsProject) {
64  innerRule.onMatch(call);
65  }
66  }
+ Here is the call graph for this function:

◆ unwrap()

static RelNode com.mapd.calcite.parser.ProjectProjectRemoveRule.unwrap ( RelNode  node)
inlinestaticpackage

Definition at line 33 of file ProjectProjectRemoveRule.java.

Referenced by com.mapd.calcite.parser.ProjectProjectRemoveRule.onMatch().

33  {
34  if (node instanceof HepRelVertex) {
35  return unwrap(((HepRelVertex) node).getCurrentRel());
36  }
37 
38  return node;
39  }
+ Here is the caller graph for this function:

Member Data Documentation

◆ innerRule

ProjectRemoveRule com.mapd.calcite.parser.ProjectProjectRemoveRule.innerRule
private

Definition at line 44 of file ProjectProjectRemoveRule.java.

◆ INSTANCE

final ProjectProjectRemoveRule com.mapd.calcite.parser.ProjectProjectRemoveRule.INSTANCE
static
Initial value:
=
new ProjectProjectRemoveRule(RelFactories.LOGICAL_BUILDER)

Definition at line 41 of file ProjectProjectRemoveRule.java.

Referenced by com.mapd.calcite.parser.MapDParser.queryToSqlNode().


The documentation for this class was generated from the following file: