FunctionContext ctx2 = avg.newContext();
for (int i = 1; i <= 10; i++) {
tuples2[i-1] = new VTuple(1);
tuples2[i-1].put(0, DatumFactory.createInt4(i));
avg.eval(ctx2, tuples2[i-1]);
}
assertTrue((double)55 / 10 == avg.terminate(ctx2).asFloat8());
avg.merge(ctx, new VTuple(new Datum[] {avg.getPartialResult(ctx2)}));