Package org.yamcs.yarch.streamsql
Class AggregateExpression
- java.lang.Object
-
- org.yamcs.yarch.streamsql.Expression
-
- org.yamcs.yarch.streamsql.AggregateExpression
-
- Direct Known Subclasses:
AggregateListExpression,CompilableAggregateExpression,FirstValExpression
public abstract class AggregateExpression extends Expression
Expressions containing aggregates are computed in two phases: phase 1: the input tuples are passed to a list of expressions composed by the group by columns and the list of aggregates phase 2: the output tuples of phase 1 are passed to the list of original select list. In this phase, aggregates act as a ColumnExpression
-
-
Field Summary
-
Fields inherited from class org.yamcs.yarch.streamsql.Expression
children, constantValue, hasAggregates, inputDef, type
-
-
Constructor Summary
Constructors Constructor Description AggregateExpression(Expression[] args, boolean star)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidbind(TupleDefinition def)voidbindAggregate(TupleDefinition def)When this is called, all the children are already bound.CompiledExpressioncompile()voidfillCode_getValueReturn(StringBuilder code)abstract CompiledAggregateExpressiongetCompiledAggregate()protected booleanisAggregate()-
Methods inherited from class org.yamcs.yarch.streamsql.Expression
addFilter, collectAggregates, doBind, fillCode_AllInputDefVars, fillCode_Constructor, fillCode_Declarations, fillCode_getValueBody, getColumnName, getConstantValue, getType, isConstant, setColumnName
-
-
-
-
Constructor Detail
-
AggregateExpression
public AggregateExpression(Expression[] args, boolean star) throws ParseException
- Throws:
ParseException
-
-
Method Detail
-
isAggregate
protected boolean isAggregate()
- Overrides:
isAggregatein classExpression
-
bindAggregate
public void bindAggregate(TupleDefinition def) throws StreamSqlException
When this is called, all the children are already bound.- Throws:
StreamSqlException
-
bind
public void bind(TupleDefinition def) throws StreamSqlException
- Overrides:
bindin classExpression- Throws:
StreamSqlException
-
fillCode_getValueReturn
public void fillCode_getValueReturn(StringBuilder code) throws StreamSqlException
- Specified by:
fillCode_getValueReturnin classExpression- Throws:
StreamSqlException
-
compile
public CompiledExpression compile() throws StreamSqlException
- Overrides:
compilein classExpression- Throws:
StreamSqlException
-
getCompiledAggregate
public abstract CompiledAggregateExpression getCompiledAggregate() throws StreamSqlException
- Throws:
StreamSqlException
-
-