An abstract class that represents a custom aggregate function from the DSII. More...
Public Member Functions
|virtual void||GetFunctionName (simba_wstring &out_aggrName) const =0|
|Get the name of the aggregate function. |
|virtual const std::vector|
< SqlTypeMetadata * > &
|Retrieve the metadata representing the inputs to the aggregate function. |
|virtual SqlTypeMetadata *||GetOutputMetadata ()=0|
|Retrieve the metadata representing the output of the aggregate function. |
|GetSetQuantifier () const =0|
|This method returns the set quantifier id. |
|virtual bool||UpdateMetadata (const std::vector< SqlTypeMetadata * > &in_inputMetadata, bool in_isPrepare)=0|
|Update the expected input and return metadata for the aggregate function based on the input metadata. |
Protected Member Functions
An abstract class that represents a custom aggregate function from the DSII.
Custom aggregates are not currently supported for execution, only preparation. To handle execution of custom aggregates, CQE for aggregates must be used. See IAggregationHandler.h for more information.
|virtual void GetFunctionName||(||simba_wstring &||out_aggrName||)|| const
Get the name of the aggregate function.
|out_aggrName||The name of the aggregate function.|
|virtual const std::vector<SqlTypeMetadata*>& GetInputMetadata||(||)||
Retrieve the metadata representing the inputs to the aggregate function.
Note that there must be at least one entry in the returned collection. Note also that there is currently a restriction that only one input may be used.
|virtual SqlTypeMetadata* GetOutputMetadata||(||)||
Retrieve the metadata representing the output of the aggregate function.
|virtual Simba::SQLEngine::SESetQuantifier GetSetQuantifier||(||)|| const
This method returns the set quantifier id.
|virtual bool UpdateMetadata||(||const std::vector< SqlTypeMetadata * > &||in_inputMetadata,|
Update the expected input and return metadata for the aggregate function based on the input metadata.
This function will be called at least twice, once during the preparation phase when metadata may be inaccurate due to parameters, and one or more times during execution when metadata will be accurate as parameters will have been bound.
This function will allow the aggregate function implementation to change the output metadata as well as the expected input metadata for the aggregate function if needed, however if the expected input and output metadata doesn't change based on inputs, this function can do nothing.
This function will also allow the implementation to validate the types of the input metadata to reject types that are not expected to work. For instance, if the aggregate function should only accept numeric types as input, this function could throw an exception to reject non-numeric inputs. Note that this should only happen on the second call at execution time, as at prepare time the metadata may be inaccurate. If the implementation does not do validation of types, then the SQLEngine will attempt to convert input data to match the type reported for the input argument.
|in_inputMetadata||The current metadata for each of the inputs to the aggregate function. The index of the metadata corresponds directly to the input into the aggregate function. (NOT OWN)|
|in_isPrepare||Flag indicating if this is a prepare metadata call, in which case the input metadata may not be accurate, or an execute metadata call, when the input metadata will be accurate.|