|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.ptree.util.ParseTreeVisitor | +--openjava.ptree.util.EvaluationShuttle | +--saffron.rel.InternalTranslator | +--saffron.rel.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
Field Summary | |
(package private) Vector |
aggCallVector
|
(package private) ExpressionList |
aggInputList
|
(package private) Expression[] |
groups
|
(package private) Rel[] |
inputs
|
(package private) InternalTranslator |
nonAggTranslator
|
(package private) QueryInfo |
queryInfo
|
Fields inherited from class openjava.ptree.util.EvaluationShuttle |
|
Constructor Summary | |
(package private) |
AggInternalTranslator(QueryInfo queryInfo,
Rel[] inputs,
Expression[] groups,
ExpressionList aggInputList,
Vector aggCallVector)
|
Method Summary | |
Expression |
evaluateDown(BinaryExpression p)
|
Expression |
evaluateDown(ConditionalExpression p)
|
Expression |
evaluateDown(FieldAccess p)
|
Expression |
evaluateDown(MethodCall call)
|
Expression |
evaluateDown(UnaryExpression p)
|
Expression |
evaluateDown(Variable p)
|
Expression |
evaluateUp(AliasedExpression p)
|
(package private) boolean |
isGoodAgg_obsolete(Expression expression)
|
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) Expression |
lookupExp(String name)
Returns an expression with which to reference a from-list item. |
private Expression |
makeAggExp(Aggregation aggregation,
ExpressionList args)
|
private Expression |
toGroupReference(Expression expression,
boolean fail)
|
void |
visit(QueryExpression p)
Do not walk into a sub-query. |
Methods inherited from class openjava.ptree.util.ParseTreeVisitor |
visit, visit, visit, visit, visit, visit, visit, visit, visit |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
Expression[] groups
ExpressionList aggInputList
Vector aggCallVector
InternalTranslator nonAggTranslator
QueryInfo queryInfo
Rel[] inputs
Constructor Detail |
AggInternalTranslator(QueryInfo queryInfo, Rel[] inputs, Expression[] groups, ExpressionList aggInputList, Vector aggCallVector)
Method Detail |
private Expression toGroupReference(Expression expression, boolean fail)
public Expression evaluateDown(MethodCall call) throws ParseTreeException
evaluateDown
in class EvaluationShuttle
ParseTreeException
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 Expression makeAggExp(Aggregation aggregation, ExpressionList args) throws ParseTreeException
ParseTreeException
public Expression evaluateDown(FieldAccess p)
evaluateDown
in class EvaluationShuttle
public Expression evaluateDown(UnaryExpression p)
evaluateDown
in class EvaluationShuttle
public Expression evaluateDown(BinaryExpression p)
evaluateDown
in class EvaluationShuttle
public Expression evaluateDown(ConditionalExpression p)
evaluateDown
in class EvaluationShuttle
public Expression evaluateDown(Variable p)
evaluateDown
in class InternalTranslator
boolean isGoodAgg_obsolete(Expression expression)
public Expression evaluateUp(AliasedExpression p)
evaluateUp
in class EvaluationShuttle
public void visit(QueryExpression p)
visit
in class EvaluationShuttle
Expression lookupExp(String name)
name
- the alias of the from item
Variable
or FieldAccess
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |