net.sf.saffron.rel
Class ProjectRelBase

java.lang.Object
  |
  +--net.sf.saffron.rel.SaffronRel
        |
        +--net.sf.saffron.rel.SingleRel
              |
              +--net.sf.saffron.rel.ProjectRelBase
Direct Known Subclasses:
IterCalcRel, ProjectRel

public abstract class ProjectRelBase
extends SingleRel

ProjectRelBase is an abstract base class for SaffronRels which perform projection. SaffronRels which combine projection with other operations should subclass ProjectRelBase rather than ProjectRel (which represents pure projection).


Nested Class Summary
static interface ProjectRelBase.Flags
           
 
Field Summary
protected  RexNode[] exps
           
protected  String[] fieldNames
           
protected  int flags
          Values defined in ProjectRelBase.Flags.
 
Fields inherited from class net.sf.saffron.rel.SingleRel
child
 
Fields inherited from class net.sf.saffron.rel.SaffronRel
cluster, digest, emptyArray, id, nextId, rowType
 
Constructor Summary
protected ProjectRelBase(VolcanoCluster cluster, SaffronRel child, RexNode[] exps, String[] fieldNames, int flags)
          Creates a Project.
 
Method Summary
 PlanCost computeSelfCost(SaffronPlanner planner)
          Returns the cost of this plan (not including children).
protected  void defineTerms(String[] terms)
           
protected  SaffronType deriveRowType()
           
 void explain(PlanWriter pw)
           
 RexNode[] getChildExps()
          Returns an array of this SaffronRel's child expressions (not including the inputs returned by SingleRel.getInputs().
 String[] getFieldNames()
           
 int getFlags()
           
 SaffronRel implementFieldAccess(RelImplementor implementor, String fieldName)
          Burrows into a synthetic record and returns the underlying relation which provides the field called fieldName.
 boolean isBoxed()
           
 
Methods inherited from class net.sf.saffron.rel.SingleRel
childrenAccept, getInputs, getRows, replaceInput
 
Methods inherited from class net.sf.saffron.rel.SaffronRel
clone, computeDigest, getCluster, getConvention, getCorrelVariable, getId, getInput, getOrCreateCorrelVariable, getQualifier, getQuery, getRelTypeName, getRowType, getTable, getVariablesStopped, implement, isAccessTo, isDistinct, onRegister, recomputeDigest, register, registerCorrelVariable, setCorrelVariable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

exps

protected RexNode[] exps

fieldNames

protected String[] fieldNames

flags

protected int flags
Values defined in ProjectRelBase.Flags.

Constructor Detail

ProjectRelBase

protected ProjectRelBase(VolcanoCluster cluster,
                         SaffronRel child,
                         RexNode[] exps,
                         String[] fieldNames,
                         int flags)
Creates a Project.

Parameters:
cluster - VolcanoCluster this relational expression belongs to
child - input relational expression
exps - set of expressions for the input columns
fieldNames - aliases of the expressions
flags - values as in ProjectRelBase.Flags
Method Detail

isBoxed

public boolean isBoxed()

getChildExps

public RexNode[] getChildExps()
Description copied from class: SaffronRel
Returns an array of this SaffronRel's child expressions (not including the inputs returned by SaffronRel.getInputs(). If there are no child expressions, returns an empty array, not null.

Overrides:
getChildExps in class SaffronRel

getFieldNames

public String[] getFieldNames()

getFlags

public int getFlags()

computeSelfCost

public PlanCost computeSelfCost(SaffronPlanner planner)
Description copied from class: SaffronRel
Returns the cost of this plan (not including children). The base implementation throws an error; derived classes should override.

Overrides:
computeSelfCost in class SaffronRel

defineTerms

protected void defineTerms(String[] terms)

explain

public void explain(PlanWriter pw)
Overrides:
explain in class SingleRel

implementFieldAccess

public SaffronRel implementFieldAccess(RelImplementor implementor,
                                       String fieldName)
Description copied from class: SaffronRel
Burrows into a synthetic record and returns the underlying relation which provides the field called fieldName.

Overrides:
implementFieldAccess in class SaffronRel

deriveRowType

protected SaffronType deriveRowType()
Overrides:
deriveRowType in class SingleRel

SourceForge.net_Logo