... outPreds = qci.getOnOutputPredicates(); ... for (OnOutputPredicate outPred : outPreds) { boolean pushedToFunction = false; List<ColumnDefinition> predOutCols = outPred.getColumns(); ... // The following is an example of predicate push-down to input, // where input column names are different // from output column names. // Semantically, the md5sum column doesn't have an input counter-part, // so the predicate on that column cannot be pushed down. // Thus, some predicates can be pushed down to input, and some cannot // depending on which columns are involved in the predicate. // This is specified in the completePlanningContract method // if (!pushedToFunction) { // The helper function returns a 1-to-1 mapping of the output // columns mapped to their input counterparts. // If no such mapping can be made (for instance, if the // output column corresponds to an md5sum for which there is no // corresponding input), the helper function returns null List<ColumnDefinition> mappedCols = mapOutputColumnsToInput (predOutCols); if (mappedCols != null) { OnInputPredicate onInputPredicate = outPred.pushToInput(mappedCols); onInputPredicates.add(onInputPredicate); } } } // for each outPred ... InputContext inputContext = new InputContext.Builder() ... .setOnInputPredicates(onInputPredicates) .toInputContext(); ...
For full context, see Examples.