public void testIncrement6() {
Schema schema = new Schema()
.addColumn("l_orderkey", Type.FLOAT8)
.addColumn("l_linenumber", Type.FLOAT8)
.addColumn("final", Type.FLOAT8);
Tuple s = new VTuple(3);
s.put(0, DatumFactory.createFloat8(1.1d));
s.put(1, DatumFactory.createFloat8(1.1d));
s.put(2, DatumFactory.createFloat8(1.1d));
Tuple e = new VTuple(3);
e.put(0, DatumFactory.createFloat8(4.1d)); // 4
e.put(1, DatumFactory.createFloat8(2.1d)); // 2
e.put(2, DatumFactory.createFloat8(3.1d)); //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);
assertTrue(1.1d == beforeOverflow.get(0).asFloat8());
assertTrue(2.1d == beforeOverflow.get(1).asFloat8());
assertTrue(3.1d == beforeOverflow.get(2).asFloat8());
Tuple overflow = partitioner.increment(beforeOverflow, 1, 2);
assertTrue(2.1d == overflow.get(0).asFloat8());
assertTrue(1.1d == overflow.get(1).asFloat8());
assertTrue(1.1d == overflow.get(2).asFloat8());
}