Defines the interface for passing down a relational AGGREGATION operation to the DSII. More...
Inherited by DSIExtAbstractAggregationHandler.
Public Member Functions
< DSIExtResultSet >
|Passdown (AEAggregate *in_node)=0|
|Pass down the given AGGREGATION operation. |
Protected Member Functions
Defines the interface for passing down a relational AGGREGATION operation to the DSII.
An AGGREGATION is defined by an optional GROUPING_LIST and an AGGREGATE_LIST. For example in the following query:
"C1, C2" is the GROUPING_LIST. "C1, C2, AVG(C3), SUM(C4)" is the AGGREGATE_LIST. In other words, the aggregation list contains every aggregation, while the grouping list only contains those expressions in the GROUP BY clause.
If a query containing an aggregation is in a complicated form, SimbaEngine will transform it into the "standard" form seen above. For example, for the following query:
SimbaEngine will ensure that an IAggregationHandler object only need to deal with a query like this:
Furthermore, if the relational operations proceeding an AGGREGATION relational operation were not all passed down successfully, a handler to perform aggregate pass-down will never be invoked. For example in the following query:
If either the filter "T1.C2 > 0" or the inner join "T1 join T2 on T1.C1 = T2.C1" is not successfully passed down, passing down the aggregation will not be attempted.
The result returned from Passdown(), if the aggregation was successfully passed down, should contain one column for each item in the AGGREGATE_LIST, in the order that it appears in the AGGREGATE_LIST. If there are no items in the GROUPING_LIST, then the result should only have a single row. Otherwise, there should be one row for each group specified by the set of items in the GROUPING_LIST. For example, the following query:
would have two columns, one for C1 and one for COUNT(*), and should return a row for every different value of C1. If the table was as follows:
C1 | C2 --- | --- A | B A | D B | E
then the returned result should look like the following:
C1 | COUNT(*) --- | -------- A | 2 B | 1
If a column is in the GROUPING_LIST but not in the SELECT_LIST, it should still be included in the select list of the result generated from the aggregation handler. The SQLEngine will simply not ask this column for data during data retrieval. Note that the columns and expressions should still appear in the select list in the same order the Set*() functions are called.
Pass down the given AGGREGATION operation.
An implementation _MUST_ ensure that this method returns the table representing the aggregation result if and only if the whole aggregation operation is successfully passed down. Otherwise, it should return NULL and in_node remains intact.
|in_node||The aggregation operation node. Cannot be NULL. (NOT OWN)|
Implemented in DSIExtAbstractAggregationHandler.