@Test public void testIncrement5() {
Schema schema = new Schema()
.addColumn("l_orderkey", Type.INT8)
.addColumn("l_linenumber", Type.INT8)
.addColumn("final", Type.INT8);
Tuple s = new VTuple(3);
s.put(0, DatumFactory.createInt8(1));
s.put(1, DatumFactory.createInt8(1));
s.put(2, DatumFactory.createInt8(1));
Tuple e = new VTuple(3);
e.put(0, DatumFactory.createInt8(4)); // 4
e.put(1, DatumFactory.createInt8(2)); // 2
e.put(2, DatumFactory.createInt8(3)); //x3 = 24
TupleRange expected = new TupleRange(schema, s, e);
UniformRangePartition partitioner
= new UniformRangePartition(schema, expected);
assertEquals(24, partitioner.getTotalCardinality().longValue());
Tuple beforeOverflow = partitioner.increment(s, 5, 2);
assertEquals(1, beforeOverflow.get(0).asInt8());
assertEquals(2, beforeOverflow.get(1).asInt8());
assertEquals(3, beforeOverflow.get(2).asInt8());
Tuple overflow = partitioner.increment(beforeOverflow, 1, 2);
assertEquals(2, overflow.get(0).asInt8());
assertEquals(1, overflow.get(1).asInt8());
assertEquals(1, overflow.get(2).asInt8());
}