TaQL node representing a scalar aggregate function. More...
#include <ExprAggrNode.h>
Public Member Functions | |
TableExprAggrNode (FunctionType, NodeDataType, ValueType, const TableExprNodeSet &source) | |
Constructor. | |
virtual void | getAggrNodes (vector< TableExprNodeRep * > &aggr) |
Get the nodes representing an aggregate function. | |
TableExprNodeRep * | operand () |
Get the operand node. | |
virtual CountedPtr < TableExprGroupFuncBase > | makeGroupAggrFunc () |
Create the correct aggregate function object. | |
virtual Bool | isLazyAggregate () const |
Is the aggregate function a lazy or an immediate one? | |
virtual Bool | getBool (const TableExprId &id) |
Functions to get the result of an aggregate function. | |
virtual Int64 | getInt (const TableExprId &id) |
virtual Double | getDouble (const TableExprId &id) |
virtual DComplex | getDComplex (const TableExprId &id) |
virtual String | getString (const TableExprId &id) |
virtual MVTime | getDate (const TableExprId &id) |
Static Public Member Functions | |
static NodeDataType | checkOperands (Block< Int > &dtypeOper, ValueType &resVT, FunctionType ftype, PtrBlock< TableExprNodeRep * > &nodes) |
Check the operands of the aggregate function and return the result's data type. | |
Private Member Functions | |
TableExprGroupFuncBase * | doMakeGroupAggrFunc () |
Do the actual creation of the correct aggregate function object. | |
Private Attributes | |
CountedPtr < TableExprGroupFuncBase > | itsFunc |
TaQL node representing a scalar aggregate function.
Internal
A TableExprAggrNode object is a special TableExprFuncNode object. Instead of operating on a single row, it operates on a group of table rows, usually formed by means of the GROUPBY clause. It aggregates the values in the rows in the group by means of an aggregation function derived from TableExprGroupFuncBase. Several standard aggregation functions (e.g., gmean, gmin, gsum) are defined in TaQL and implemented this way.
There are two types of aggregate function implementations:
Note that this class handles operands that are a scalar or array. If array, all values in the array are used as individual values. Class TableExprAggrNodeArray handles aggregate functions giving an array result (e.g., function gaggr
).
It is also possible to define an aggregate function in a UDF derived from class UDFBase. Such an aggregate function is instantiated as a TableExprUDFNode(Array) object, not as TabeExprAggrNode(Array). These functions are always lazy.
Definition at line 83 of file ExprAggrNode.h.
casacore::TableExprAggrNode::TableExprAggrNode | ( | FunctionType | , | |
NodeDataType | , | |||
ValueType | , | |||
const TableExprNodeSet & | source | |||
) |
Constructor.
static NodeDataType casacore::TableExprAggrNode::checkOperands | ( | Block< Int > & | dtypeOper, | |
ValueType & | resVT, | |||
FunctionType | ftype, | |||
PtrBlock< TableExprNodeRep * > & | nodes | |||
) | [static] |
Check the operands of the aggregate function and return the result's data type.
TableExprGroupFuncBase* casacore::TableExprAggrNode::doMakeGroupAggrFunc | ( | ) | [private] |
Do the actual creation of the correct aggregate function object.
virtual void casacore::TableExprAggrNode::getAggrNodes | ( | vector< TableExprNodeRep * > & | aggr | ) | [virtual] |
Get the nodes representing an aggregate function.
Reimplemented from casacore::TableExprNodeMulti.
virtual Bool casacore::TableExprAggrNode::getBool | ( | const TableExprId & | id | ) | [virtual] |
Functions to get the result of an aggregate function.
Reimplemented from casacore::TableExprFuncNode.
virtual MVTime casacore::TableExprAggrNode::getDate | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::TableExprFuncNode.
virtual DComplex casacore::TableExprAggrNode::getDComplex | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::TableExprFuncNode.
virtual Double casacore::TableExprAggrNode::getDouble | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::TableExprFuncNode.
virtual Int64 casacore::TableExprAggrNode::getInt | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::TableExprFuncNode.
virtual String casacore::TableExprAggrNode::getString | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casacore::TableExprFuncNode.
virtual Bool casacore::TableExprAggrNode::isLazyAggregate | ( | ) | const [virtual] |
Is the aggregate function a lazy or an immediate one?
Reimplemented from casacore::TableExprNodeRep.
virtual CountedPtr<TableExprGroupFuncBase> casacore::TableExprAggrNode::makeGroupAggrFunc | ( | ) | [virtual] |
Create the correct aggregate function object.
It is also kept in case it is a lazy aggregate function.
Reimplemented from casacore::TableExprNodeRep.
TableExprNodeRep* casacore::TableExprAggrNode::operand | ( | ) | [inline] |
Get the operand node.
Definition at line 100 of file ExprAggrNode.h.
References casacore::TableExprFuncNode::operands().
Definition at line 125 of file ExprAggrNode.h.