TypeInfo[] inputTypes, Iterator<T> inVals,
TypeHandler<T, TW> typeHandler, TW[] in, ObjectInspector[] inputOIs,
int inSz, int numPreceding, int numFollowing, Iterator<T> outVals)
throws HiveException {
GenericUDAFEvaluator fn = fnR.getEvaluator(inputTypes);
fn.init(Mode.COMPLETE, inputOIs);
fn = fn.getWindowingEvaluator(wdwFrame(numPreceding, numFollowing));
AggregationBuffer agg = fn.getNewAggregationBuffer();
ISupportStreamingModeForWindowing oS = (ISupportStreamingModeForWindowing) fn;
int outSz = 0;
while (inVals.hasNext()) {
typeHandler.set(inVals.next(), in[0]);
fn.aggregate(agg, in);
Object out = oS.getNextResult(agg);
if (out != null) {
if ( out == ISupportStreamingModeForWindowing.NULL_RESULT ) {
out = null;
} else {
try {
out = typeHandler.get((TW) out);
} catch(ClassCastException ce) {
}
}
Assert.assertEquals(out, outVals.next());
outSz++;
}
}
fn.terminate(agg);
while (outSz < inSz) {
Object out = oS.getNextResult(agg);
if ( out == ISupportStreamingModeForWindowing.NULL_RESULT ) {
out = null;