The following figure illustrates control and data flow during execution.
Control and data flow during execution
- The Analytic Engine constructs the SQL-MapReduce function on every vWorker.
- The Analytic Engine sends the completed planning contract in the CollaborativePlanning.receiveCompletedPlanningContract() method.
The completed planning contract consists of the input properties of the chosen plan and the output properties returned by the SQL-MapReduce function, the query context, and the response to the query context from the SQL-MapReduce function.
The nth negotiated contract is not necessarily the one sent to the function. - The SQL-MapReduce function's operateOnSomeRows() or operateOnPartition() method is called.
- If the Drainable interface is implemented, the SQL-MapReduce function’s drainOutputRows() method is called.The operateOnSomeRows(), operateOnPartition(), and drainOutputRows() methods should be implemented to honour the completed planning contract.The Analytic Engine does not validate the application of the completed planning contract by the SQL-MapReduce function. Incorrect implementation can result in incorrect results.