|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saffron.oj.xlat.InternalTranslator | +--net.sf.saffron.oj.xlat.AggInternalTranslator
Converts expressions to consist only of constants, references to group by expressions (variables called "$group0", etc.), and calls to aggregate functions (variables called "$agg0", etc.).
These names exist only fleetingly, before AggUnpickler
converts
them to field references in the output record. But if we did not use them,
we could not be sure whether a field reference such as $input0.$f1 had
been converted.
Throws NotAGroupException
.
AggUnpickler
Nested Class Summary | |
(package private) static class |
AggInternalTranslator.RexAggVariable
Reference to an aggregation expression of the current aggregator. |
(package private) static class |
AggInternalTranslator.RexGroupVariable
Reference to a key of the current aggregator. |
(package private) static class |
InternalTranslator.RexQuery
Temporary holder for a scalar query which has not been translated yet. |
Field Summary | |
(package private) Vector |
aggCallVector
|
(package private) ArrayList |
aggInputList
|
(package private) Expression[] |
groups
|
(package private) SaffronRel[] |
inputs
|
(package private) InternalTranslator |
nonAggTranslator
|
protected QueryEnvironment |
qenv
|
(package private) QueryInfo |
queryInfo
|
protected JavaRexBuilder |
rexBuilder
|
Constructor Summary | |
(package private) |
AggInternalTranslator(QueryInfo queryInfo,
SaffronRel[] inputs,
Expression[] groups,
ArrayList aggInputList,
Vector aggCallVector,
JavaRexBuilder javaRexBuilder)
|
Method Summary | |
RexNode |
evaluateDown(BinaryExpression p)
|
RexNode |
evaluateDown(ConditionalExpression p)
|
RexNode |
evaluateDown(FieldAccess p)
|
RexNode |
evaluateDown(MethodCall call)
|
RexNode |
evaluateDown(UnaryExpression p)
|
RexNode |
evaluateDown(Variable p)
|
Expression |
evaluateUp(AliasedExpression p)
|
RexNode |
go(ParseTree p)
|
private Aggregation |
lookupBuiltinAggregation(MethodCall call,
OJClass[] argTypes)
Creates and returns an aggregation if call is a call to a
builtin, otherwise returns null. |
private Aggregation |
lookupCustomAggregation(MethodCall call,
OJClass[] argTypes)
Creates and returns an aggregation if call is a call to a
custom aggregation, null otherwise. |
(package private) QueryInfo.LookupResult |
lookupExp(String name)
Returns an expression with which to reference a from-list item. |
private RexNode |
makeAggExp(Aggregation aggregation,
ExpressionList args)
|
private RexNode |
toGroupReference(Expression expression,
boolean fail)
|
RexNode |
unpickle(RexNode rex)
Removes AggInternalTranslator.RexGroupVariable and AggInternalTranslator.RexAggVariable objects
which we created temporarily, before we knew how many groups there were
going to be. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
ArrayList aggInputList
InternalTranslator nonAggTranslator
Vector aggCallVector
Expression[] groups
QueryInfo queryInfo
SaffronRel[] inputs
protected final JavaRexBuilder rexBuilder
protected final QueryEnvironment qenv
Constructor Detail |
AggInternalTranslator(QueryInfo queryInfo, SaffronRel[] inputs, Expression[] groups, ArrayList aggInputList, Vector aggCallVector, JavaRexBuilder javaRexBuilder)
Method Detail |
public RexNode evaluateDown(FieldAccess p)
evaluateDown
in class InternalTranslator
public RexNode evaluateDown(UnaryExpression p)
evaluateDown
in class InternalTranslator
public RexNode evaluateDown(BinaryExpression p)
evaluateDown
in class InternalTranslator
public RexNode evaluateDown(ConditionalExpression p)
evaluateDown
in class InternalTranslator
public RexNode evaluateDown(Variable p)
evaluateDown
in class InternalTranslator
public RexNode evaluateDown(MethodCall call)
evaluateDown
in class InternalTranslator
private Aggregation lookupBuiltinAggregation(MethodCall call, OJClass[] argTypes)
call
is a call to a
builtin, otherwise returns null.
private Aggregation lookupCustomAggregation(MethodCall call, OJClass[] argTypes)
call
is a call to a
custom aggregation, null otherwise.
private RexNode makeAggExp(Aggregation aggregation, ExpressionList args)
private RexNode toGroupReference(Expression expression, boolean fail)
public RexNode unpickle(RexNode rex)
AggInternalTranslator.RexGroupVariable
and AggInternalTranslator.RexAggVariable
objects
which we created temporarily, before we knew how many groups there were
going to be.
public RexNode go(ParseTree p)
public Expression evaluateUp(AliasedExpression p)
QueryInfo.LookupResult lookupExp(String name)
name
- the alias of the from item
Variable
or FieldAccess
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |