// Spot check decimal scalar-column modulo
@Test
public void testDecimalScalarModuloDecimalColumn() {
VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
Decimal128 d = new Decimal128("2.00", (short) 2);
VectorExpression expr = new DecimalScalarModuloDecimalColumn(d, 0, 2);
// test without nulls
expr.evaluate(b);
DecimalColumnVector r = (DecimalColumnVector) b.cols[2];
assertTrue(r.vector[0].equals(new Decimal128("0.80", (short) 2)));
assertTrue(r.vector[1].equals(new Decimal128("2.00", (short) 2)));
assertFalse(r.noNulls); // entry 2 will be null due to zero-divide
assertTrue(r.isNull[2]);
// try again with some different data values
DecimalColumnVector in = (DecimalColumnVector) b.cols[0];
in.vector[0].update("0.50", (short) 2);
in.vector[1].update("0.80", (short) 2);
in.vector[2].update("0.70", (short) 2);
expr.evaluate(b);
assertTrue(r.vector[0].equals(new Decimal128("0.00", (short) 2)));
assertTrue(r.vector[1].equals(new Decimal128("0.40", (short) 2)));
assertTrue(r.vector[2].equals(new Decimal128("0.60", (short) 2)));
}