The CompletedContract object, which is constructed from the PlanningContract class, implements the reply sent from SQL-MapReduce function to the Planner.
The reply includes:
- An instance of the PlanOutputInfo class, which includes instances of these classes:
- Distribution
-
Order
The function simply tells the planner what the properties are during planning.
- An instance of the QueryContextReply class, which includes the following information that the function needs in order to take the appropriate action during execution to enforce the promised contract:
- Reply to output column projection in the form of a boolean.
- Reply to order and limit in the form of a boolean.
- One or more instances of the ByFunctionPredicate class.
- An instance of the InputContext class (for each input)The InputContext class includes these fields, which provide information about the input columns needed for input projection and the predicates that can be applied on this input:
- The input name, which you can obtain by calling InputInfo.getInputName().
- An instance of the OnInputPredicate class.
- Input columns needed, which you can obtain by adding columns from the input that are not in the list of project output columns.
- An instance of the FunctionState class. This instance is cached during query compilation and reused during query execution.