// Spot check decimal column-column subtract
@Test
public void testDecimalColSubtractDecimalColumn() {
VectorizedRowBatch b = getVectorizedRowBatch3DecimalCols();
VectorExpression expr = new DecimalColSubtractDecimalColumn(0, 1, 2);
DecimalColumnVector r = (DecimalColumnVector) b.cols[2];
// test without nulls
expr.evaluate(b);
assertTrue(r.vector[0].equals(new Decimal128("0.20", (short) 2)));
assertTrue(r.vector[1].equals(new Decimal128("-4.30", (short) 2)));
assertTrue(r.vector[2].equals(new Decimal128("-1.00", (short) 2)));
// test that underflow produces NULL
b = getVectorizedRowBatch3DecimalCols();
DecimalColumnVector c0 = (DecimalColumnVector) b.cols[0];
c0.vector[0].update("-9999999999999999.99", (short) 2); // set to min possible value
r = (DecimalColumnVector) b.cols[2];
expr.evaluate(b); // will cause underflow for result at position 0, must yield NULL
assertTrue(!r.noNulls && r.isNull[0]);
}