*/
@Test
public void testDecimalColDivideDecimalScalar() {
VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
Decimal128 d = new Decimal128("2.00", (short) 2);
VectorExpression expr = new DecimalColDivideDecimalScalar(0, d, 2);
// test without nulls
expr.evaluate(b);
DecimalColumnVector r = (DecimalColumnVector) b.cols[2];
assertTrue(r.vector[0].equals(new Decimal128("0.60", (short) 2)));
assertTrue(r.vector[1].equals(new Decimal128("-1.65", (short) 2)));
assertTrue(r.vector[2].equals(new Decimal128("0", (short) 2)));
// test null propagation
b = getVectorizedRowBatch3DecimalCols();
DecimalColumnVector in = (DecimalColumnVector) b.cols[0];
r = (DecimalColumnVector) b.cols[2];
in.noNulls = false;
in.isNull[0] = true;
expr.evaluate(b);
assertTrue(!r.noNulls);
assertTrue(r.isNull[0]);
// test repeating case, no nulls
b = getVectorizedRowBatch3DecimalCols();
in = (DecimalColumnVector) b.cols[0];
in.isRepeating = true;
expr.evaluate(b);
r = (DecimalColumnVector) b.cols[2];
assertTrue(r.isRepeating);
assertTrue(r.vector[0].equals(new Decimal128("0.60", (short) 2)));
// test repeating case for null value
b = getVectorizedRowBatch3DecimalCols();
in = (DecimalColumnVector) b.cols[0];
in.isRepeating = true;
in.isNull[0] = true;
in.noNulls = false;
expr.evaluate(b);
r = (DecimalColumnVector) b.cols[2];
assertTrue(r.isRepeating);
assertTrue(!r.noNulls);
assertTrue(r.isNull[0]);
// test that zero-divide produces null for all output values
b = getVectorizedRowBatch3DecimalCols();
in = (DecimalColumnVector) b.cols[0];
expr = new DecimalColDivideDecimalScalar(0, new Decimal128("0", (short) 2), 2);
expr.evaluate(b);
r = (DecimalColumnVector) b.cols[2];
assertFalse(r.noNulls);
assertTrue(r.isNull[0]);
assertTrue(r.isRepeating);
}