Package org.apache.tajo.engine.function.builtin

Examples of org.apache.tajo.engine.function.builtin.AvgLong.newContext()


      tuples[i-1] = new VTuple(1);
      tuples[i-1].put(0, DatumFactory.createInt4(i));
    }

    AvgLong avg = new AvgLong();
    FunctionContext ctx = avg.newContext();
    for (int i = 1; i <= 5; i++) {
      avg.eval(ctx, tuples[i-1]);
    }

    assertTrue(15 / 5 == avg.terminate(ctx).asFloat8());
View Full Code Here


    assertTrue(15 / 5 == avg.terminate(ctx).asFloat8());


    Tuple [] tuples2 = new Tuple[10];

    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]);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.