private void longColAddLongScalarCheckedWithNulls(boolean isChecked) throws HiveException {
    VectorizedRowBatch batch = getVectorizedRowBatchSingleLongVector(
        VectorizedRowBatch.DEFAULT_SIZE);
    LongColumnVector lcv = (LongColumnVector) batch.cols[0];
    LongColumnVector lcvOut = (LongColumnVector) batch.cols[1];
    TestVectorizedRowBatch.addRandomNulls(lcv);
    VectorExpression expr;
    if (isChecked) {
      expr = new LongColAddLongScalarChecked(0, 23, 1);
      expr.setOutputTypeInfo(TypeInfoFactory.getPrimitiveTypeInfo("bigint"));
    } else {
      expr = new LongColAddLongScalar(0, 23, 1);
    }
    expr.evaluate(batch);

    // verify
    for (int i=0; i < VectorizedRowBatch.DEFAULT_SIZE; i++) {
      if (!lcv.isNull[i]) {
        Assert.assertEquals(i*37+23, lcvOut.vector[i]);
      } else {
        Assert.assertTrue(lcvOut.isNull[i]);
      }
    }
    Assert.assertFalse(lcvOut.noNulls);
    Assert.assertFalse(lcvOut.isRepeating);
    verifyLongNullDataVectorEntries(lcvOut, batch.selected, batch.selectedInUse, batch.size);
  }
Unit tests for vectorized arithmetic expressions.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java