SQL Aggregator
CDSCs can optionally implement basic aggregation services and delegate to the SQL Aggregator when the aggregation expressions become too complex. This process is best illustrated by first examining the order of processing when a CDSC does not perform aggregation.
The basic steps are:
▪The SQL statement text is parsed by the Provider and SQL keyword tokens are returned with the expression text extracted and left unparsed.
▪The expression statements are passed to the Evaluate component, which parses the expressions and returns a list of tokens and expression p-code programs. The token names are resolved to variable names using the MDM.
▪The Provider binds to the required CDSC data, using the bindings returned by the Evaluate component. A command accessor is then available for the bound variables.
▪The table accessor is passed back to the consumer application.
▪Using the Provider accessor facility, results are returned to the consumer application. The values for each row need to be retrieved from the CDSC, passed on to the Evaluate component and sent to the consumer application.
These steps are numbered on the following diagram, which represents this order of processing when a CDSC does not perform aggregation.
When the CDSC requires aggregation, the steps are basically the same, except that the SQL Aggregator performs the aggregation. The SQL Aggregator:
▪Retrieves all of the records in the rowset before returning rows for final expression evaluation by the Evaluate component.
▪Implements default aggregation.
See also