// Spot check Decimal Col-Scalar Modulo
@Test
public void testDecimalColModuloDecimalScalar() {
VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
Decimal128 d = new Decimal128("2.00", (short) 2);
VectorExpression expr = new DecimalColModuloDecimalScalar(0, d, 2);
// test without nulls
expr.evaluate(b);
DecimalColumnVector r = (DecimalColumnVector) b.cols[2];
assertTrue(r.vector[0].equals(new Decimal128("1.20", (short) 2)));
assertTrue(r.vector[1].equals(new Decimal128("-1.30", (short) 2)));
assertTrue(r.vector[2].equals(new Decimal128("0", (short) 2)));
// try again with some different data values and divisor
DecimalColumnVector in = (DecimalColumnVector) b.cols[0];
in.vector[0].update("15.40", (short) 2);
in.vector[1].update("-17.20", (short) 2);
in.vector[2].update("70.00", (short) 2);
d.update("4.75", (short) 2);
expr.evaluate(b);
assertTrue(r.vector[0].equals(new Decimal128("1.15", (short) 2)));
assertTrue(r.vector[1].equals(new Decimal128("-2.95", (short) 2)));
assertTrue(r.vector[2].equals(new Decimal128("3.50", (short) 2)));
// try a zero-divide to show a repeating NULL is produced
d.update("0", (short) 2);
expr.evaluate(b);
assertFalse(r.noNulls);
assertTrue(r.isNull[0]);
assertTrue(r.isRepeating);
}