net.sf.saffron.oj.rel
Class JavaProjectRel
java.lang.Object
|
+--net.sf.saffron.rel.SaffronRel
|
+--net.sf.saffron.rel.SingleRel
|
+--net.sf.saffron.rel.ProjectRelBase
|
+--net.sf.saffron.rel.ProjectRel
|
+--net.sf.saffron.oj.rel.JavaProjectRel
- All Implemented Interfaces:
- JavaRel
- public class JavaProjectRel
- extends ProjectRel
- implements JavaRel
Implements the ProjectRel
relational
expression as Java code.
Methods inherited from class net.sf.saffron.rel.SaffronRel |
computeDigest, getCluster, getCorrelVariable, getId, getInput, getOrCreateCorrelVariable, getQualifier, getQuery, getRelTypeName, getRowType, getTable, getVariablesStopped, isAccessTo, isDistinct, onRegister, recomputeDigest, register, registerCorrelVariable, setCorrelVariable, toString |
JavaProjectRel
public JavaProjectRel(VolcanoCluster cluster,
SaffronRel child,
RexNode[] exps,
String[] fieldNames,
int flags)
getConvention
public CallingConvention getConvention()
- Description copied from class:
SaffronRel
- Returns a value from
CallingConvention
.
- Overrides:
getConvention
in class SaffronRel
clone
public Object clone()
- Overrides:
clone
in class ProjectRel
implement
public Object implement(RelImplementor implementor,
int ordinal)
- Description copied from class:
SaffronRel
- Create a plan for this expression according to a calling convention.
- Overrides:
implement
in class SaffronRel
- Parameters:
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.
implementSelf
public Expression implementSelf(RelImplementor implementor)
- Generates the initializer for the variable which holds the current row
of this project. If the row-type V is complex, generate
V v = new V(exp, ...);
{parent-handler(v)}
If the row-type is simple, generate
V v = exp;
{parent-handler(v)}
Todo: map relations to expressions (not variables), so we don't have to
create new objects:
T1 v1 = exp1;
T2 v2 = exp2;
{parent-handler(v1,v2)}
Or at least, create a holder object outside the loop, and just assign
into it:
V v = new V();
{loop} {
v.v1 = exp1;
v.v2 = exp2;
{parent-handler(v)}
}
- Specified by:
implementSelf
in interface JavaRel
- See Also:
RelImplementor.bind(SaffronRel,SaffronRel)