net.sf.farrago.namespace.mql
Class MedMqlPushDownRule

java.lang.Object
  extended by org.eigenbase.relopt.RelOptRule
      extended by net.sf.farrago.namespace.mql.MedMqlPushDownRule

 class MedMqlPushDownRule
extends RelOptRule

MedMqlPushDownRule is an optimizer rule to push filters and projections down into MQL.

Version:
$Id: //open/dev/farrago/ext/mql/src/net/sf/farrago/namespace/mql/MedMqlPushDownRule.java#4 $
Author:
John Sichi

Field Summary
 
Fields inherited from class org.eigenbase.relopt.RelOptRule
ANY, description, operands
 
Constructor Summary
MedMqlPushDownRule(RelOptRuleOperand operand, String id)
          Creates a MedMqlPushDownRule.
 
Method Summary
private  RelNode createFarragoUdxRel(MedMqlTableRel tableRel, RelDataType rowType, Map<String,String> fieldBindings)
           
private  Map<String,String> createFieldBindings(MedMqlTableRel tableRel)
           
 void onMatch(RelOptRuleCall call)
          Receives notification about a rule match.
private  void transformToFarragoUdxRel(RelOptRuleCall call, MedMqlTableRel tableRel, FilterRel filter, ProjectRel topProj, ProjectRel bottomProj)
           
private  RexNode translateFilter(FilterRel filterRel, String[] fieldNames, Map<String,String> fieldBindings)
           
private  boolean validProjection(String[] fieldNames)
           
 
Methods inherited from class org.eigenbase.relopt.RelOptRule
convert, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, mergeTraitsAndConvert, mergeTraitsAndConvert, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MedMqlPushDownRule

public MedMqlPushDownRule(RelOptRuleOperand operand,
                          String id)
Creates a MedMqlPushDownRule.

Method Detail

onMatch

public void onMatch(RelOptRuleCall call)
Description copied from class: RelOptRule
Receives notification about a rule match. At the time that this method is called, call.rels holds the set of relational expressions which match the operands to the rule; call.rels[0] is the root expression.

Typically a rule would check that the nodes are valid matches, creates a new expression, then calls back RelOptRuleCall.transformTo(org.eigenbase.rel.RelNode) to register the expression.

Specified by:
onMatch in class RelOptRule
Parameters:
call - Rule call
See Also:
RelOptRule.matches(RelOptRuleCall)

translateFilter

private RexNode translateFilter(FilterRel filterRel,
                                String[] fieldNames,
                                Map<String,String> fieldBindings)

validProjection

private boolean validProjection(String[] fieldNames)

createFieldBindings

private Map<String,String> createFieldBindings(MedMqlTableRel tableRel)

createFarragoUdxRel

private RelNode createFarragoUdxRel(MedMqlTableRel tableRel,
                                    RelDataType rowType,
                                    Map<String,String> fieldBindings)

transformToFarragoUdxRel

private void transformToFarragoUdxRel(RelOptRuleCall call,
                                      MedMqlTableRel tableRel,
                                      FilterRel filter,
                                      ProjectRel topProj,
                                      ProjectRel bottomProj)