@Test
public void testNtileTen() throws Exception {

    Over func = new Over();
    DataBag inbag = BagFactory.getInstance().newDefaultBag();
    Random r = new Random();
    for (int i = 0; i < 10; i++) {
        Tuple t = TupleFactory.getInstance().newTuple(2);
        t.set(0, i);
        t.set(1, r.nextInt(100));
        inbag.add(t);
    }
    Tuple t = TupleFactory.getInstance().newTuple(5);
    t.set(0, inbag);
    t.set(1, "ntile");
    t.set(2, -1);
    t.set(3, -1);
    t.set(4, 10);
    DataBag outbag = func.exec(t);
    assertEquals(10, outbag.size());
    int count = 1;
    for (Tuple to : outbag) {
        assertEquals(count, to.get(0));
        count++;
    }
}