saffron.rel
Class Project

java.lang.Object
  |
  +--saffron.rel.Rel
        |
        +--saffron.rel.SingleRel
              |
              +--saffron.rel.Project
Direct Known Subclasses:
JavaProject, PlanProject

public class Project
extends SingleRel

Project is a relational expression which computes a set of 'select expressions' from its input relational expression.

The result is usually 'boxed' as a record with one named field for each column; if there is precisely one expression, the result may be 'unboxed', and consist of the raw value type.


Nested Class Summary
private static class Project.ConvertToJavaRule
          Converts a Project to Java calling convention.
private static class Project.ConvertToPlanRule
          Converts a Project to plan calling convention.
static interface Project.Flags
           
 
Nested classes inherited from class saffron.rel.Rel
 
Field Summary
protected  Expression[] exps
           
protected  String[] fieldNames
           
protected  int flags
          Values defined in Project.Flags.
 
Fields inherited from class saffron.rel.SingleRel
child
 
Fields inherited from class saffron.rel.Rel
cluster, digest, emptyArray, id, nextId, rowType
 
Constructor Summary
Project(Cluster cluster, Rel child, Expression[] exps, String[] fieldNames, int flags)
          Creates a Project.
 
Method Summary
 Object clone()
           
 Cost computeSelfCost(Planner planner)
          Returns the cost of this plan (not including children).
protected  Type deriveRowType()
           
 void explain(PlanWriter pw)
           
 Expression[] getChildExps()
          Returns an array of this Rel's child expressions (not including the inputs returned by SingleRel.getInputs().
 int getFlags()
           
 Rel implementFieldAccess(Implementor implementor, String fieldName)
          Burrows into a synthetic record and returns the underlying relation which provides the field called fieldName.
 boolean isBoxed()
           
static void register(Planner planner)
          See Rel.register(saffron.Planner).
 
Methods inherited from class saffron.rel.SingleRel
childrenAccept, getInputs, replaceInput
 
Methods inherited from class saffron.rel.Rel
computeDigest, getCluster, getConvention, getCorelVariable, getEnvironment, getId, getInput, getOrCreateCorelVariable, getParentEnv, getQualifier, getQuery, getRelTypeName, getRows, getRowType, getTable, getType, getVariablesStopped, implement, implementExp, implementExps, implementSelf, isAccessTo, isDistinct, onRegister, recomputeDigest, registerCorelVariable, setCorelVariable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

exps

protected Expression[] exps

fieldNames

protected String[] fieldNames

flags

protected int flags
Values defined in Project.Flags.

Constructor Detail

Project

public Project(Cluster cluster,
               Rel child,
               Expression[] exps,
               String[] fieldNames,
               int flags)
Creates a Project.

Parameters:
cluster - Cluster 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 Project.Flags
Method Detail

clone

public Object clone()
Specified by:
clone in class Rel

getFlags

public int getFlags()

isBoxed

public boolean isBoxed()

deriveRowType

protected Type deriveRowType()
Overrides:
deriveRowType in class SingleRel

getChildExps

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

Overrides:
getChildExps in class Rel

explain

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

register

public static void register(Planner planner)
See Rel.register(saffron.Planner).


computeSelfCost

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

Overrides:
computeSelfCost in class Rel

implementFieldAccess

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

Overrides:
implementFieldAccess in class Rel

SourceForge.net_Logo