Example - Aster Execution Engine

Teradata Aster® Developer Guide

Product
Aster Execution Engine
Release Number
7.00.02
Published
July 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
xnl1494366523182.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
ffu1489104705746
lifecycle
previous
Product Category
Software
...
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.