Using the Drainable Interface - 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

Many functions return one output value for each input value. If there are no input values (no input rows), the value will return no rows, and the Drainable interface is not needed. However, some aggregate functions, like AVG(), or the reduce function in a map/reduce pair, should always return exactly one row no matter how many rows were input. If there were no input rows, you'd like to return one NULL value (or a row of NULL values) instead of returning zero rows. Using a drainable function allows the return of a NULL value, after all rows have been processed, if the number of rows was zero. The Drainable interface is not limited to returning exactly one row; it can return more than one row or no rows if appropriate.

For additional information on the Drainable interface, refer to the com.asterdata.ncluster.sqlmr.Interface Drainable Javadoc in the SDK bundle.