|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saffron.rel.SaffronRel
A SaffronRel
is a relational expression. It is NOT an Expression
.
If this type of relational expression has some particular rules, it should
implement the public static method register(net.sf.saffron.core.SaffronPlanner)
.
Field Summary | |
protected VolcanoCluster |
cluster
|
private String |
correlVariable
The variable by which to refer to rows from this relational expression, as correlating expressions; null if this expression is not correlated on. |
protected String |
digest
A short description of this relational expression's type, inputs, and other properties. |
(package private) static SaffronRel[] |
emptyArray
|
protected int |
id
unique id of this object -- for debugging |
(package private) static int |
nextId
generator for id values |
SaffronType |
rowType
cached type of this relational expression |
Constructor Summary | |
SaffronRel(VolcanoCluster cluster)
Creates a SaffronRel . |
Method Summary | |
void |
childrenAccept(RelVisitor visitor)
|
abstract Object |
clone()
|
protected String |
computeDigest()
Computes the digest. |
PlanCost |
computeSelfCost(SaffronPlanner planner)
Returns the cost of this plan (not including children). |
protected abstract SaffronType |
deriveRowType()
|
void |
explain(PlanWriter pw)
|
RexNode[] |
getChildExps()
Returns an array of this SaffronRel 's child expressions
(not including the inputs returned by getInputs() . |
VolcanoCluster |
getCluster()
|
CallingConvention |
getConvention()
Returns a value from CallingConvention . |
String |
getCorrelVariable()
|
int |
getId()
|
SaffronRel |
getInput(int i)
Get the i th input. |
SaffronRel[] |
getInputs()
Returns an array of this SaffronRel 's inputs. |
String |
getOrCreateCorrelVariable()
Returns a variable with which to reference the current row of this relational expression as a correlating variable. |
String |
getQualifier()
|
VolcanoQuery |
getQuery()
|
String |
getRelTypeName()
Returns the name of this SaffronRel 's class, sans package
name, for use in explain(net.sf.saffron.core.PlanWriter) . |
double |
getRows()
Returns an estimate of the number of rows this relational expression will return. |
SaffronType |
getRowType()
Returns the type of the rows returned by this relational expression. |
SaffronTable |
getTable()
If this relational expression represents an access to a table, returns that table, otherwise returns null. |
Set |
getVariablesStopped()
Returns the names of variables which are set in this relational expression but also used and therefore not available to parents of this relational expression. |
Object |
implement(RelImplementor implementor,
int ordinal)
Create a plan for this expression according to a calling convention. |
SaffronRel |
implementFieldAccess(RelImplementor implementor,
String fieldName)
Burrows into a synthetic record and returns the underlying relation which provides the field called fieldName . |
boolean |
isAccessTo(SaffronTable table)
Returns whether this relational expression is an access to table . |
boolean |
isDistinct()
Returns whether the same value will not come out twice. |
void |
onRegister(SaffronPlanner planner)
This method is called just before the expression is registered. |
String |
recomputeDigest()
Computes the digest, assigns it, and returns it. |
static void |
register(SaffronPlanner planner)
Registers any special rules specific to this kind of relational expression. |
void |
registerCorrelVariable(String correlVariable)
|
void |
replaceInput(int ordinalInParent,
SaffronRel p)
Replaces the ordinalInParent th input. |
void |
setCorrelVariable(String correlVariable)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static int nextId
id
values
static final SaffronRel[] emptyArray
public SaffronType rowType
protected String digest
computeDigest()
, assigned by onRegister(net.sf.saffron.core.SaffronPlanner)
, returned by
toString()
.
protected VolcanoCluster cluster
protected int id
private String correlVariable
Constructor Detail |
public SaffronRel(VolcanoCluster cluster)
SaffronRel
.
Method Detail |
public abstract Object clone()
clone
in class Object
public boolean isAccessTo(SaffronTable table)
table
.
public RexNode[] getChildExps()
SaffronRel
's child expressions
(not including the inputs returned by getInputs()
. If there
are no child expressions, returns an empty array, not
null
.
public VolcanoCluster getCluster()
public CallingConvention getConvention()
CallingConvention
.
public void setCorrelVariable(String correlVariable)
public String getCorrelVariable()
public boolean isDistinct()
false
, derived classes should override.
public int getId()
public SaffronRel getInput(int i)
i
th input.
public String getOrCreateCorrelVariable()
public VolcanoQuery getQuery()
public static void register(SaffronPlanner planner)
The planner calls this method this first time that it sees a relational
expression of this class. The derived class should call SaffronPlanner.addRule(net.sf.saffron.opt.VolcanoRule)
for each rule, and then call register(net.sf.saffron.core.SaffronPlanner)
on its base class.
public final String getRelTypeName()
SaffronRel
's class, sans package
name, for use in explain(net.sf.saffron.core.PlanWriter)
. For example, for a
saffron.ArrayRel.ArrayReader
, returns "ArrayReader".
public final SaffronType getRowType()
public SaffronRel[] getInputs()
SaffronRel
's inputs. If there
are no inputs, returns an empty array, not null
.
public String getQualifier()
public double getRows()
public Set getVariablesStopped()
By default, returns the empty set. Derived classes may override this method.
public void childrenAccept(RelVisitor visitor)
public PlanCost computeSelfCost(SaffronPlanner planner)
public void explain(PlanWriter pw)
public Object implement(RelImplementor implementor, int ordinal)
implementor
- implementorordinal
- indicates our position in the pre-, in- and postfix walk
over the tree; ordinal
is -1 when called from the
parent, and i
when called from the
i
th child.
UnsupportedOperationException
- if this expression cannot be
implementedpublic SaffronRel implementFieldAccess(RelImplementor implementor, String fieldName)
fieldName
.
public void onRegister(SaffronPlanner planner)
public String recomputeDigest()
public void registerCorrelVariable(String correlVariable)
public void replaceInput(int ordinalInParent, SaffronRel p)
ordinalInParent
th input. You must
override this method if you override getInputs()
.
public String toString()
toString
in class Object
public SaffronTable getTable()
protected String computeDigest()
protected abstract SaffronType deriveRowType()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |