Getter Functions: getPartialRow and getFinalValue - 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

A DecomposableAggregatorFunction must implement getPartialRow and getFinalValue methods. These two methods return the partial and final results at the end of each input partition, respectively. The partial result should be in the type RowHolder and final result should be ValueHolder.

Below is an example of a simple function that counts the number of rows for each input partition. The getPartialRow method returns the partial count as a long value in the first column of a RowView. The getFinalValue method returns the final count as a long value.

// Return the partial form of the count.
public RowView getPartialRow() {
   countRow_.setLongAt(0, count_);
   return countRow_.clone();
}

// Return the final form of the count.
public ValueHolder getFinalValue() {
   countValue_.setLong(count_);
   return countValue_.clone();
}