@Test
  public void testLongScalarSubtractLongColWithNulls() throws HiveException {
    VectorizedRowBatch batch = getVectorizedRowBatchSingleLongVector(
        VectorizedRowBatch.DEFAULT_SIZE);
    LongColumnVector lcv = (LongColumnVector) batch.cols[0];
    TestVectorizedRowBatch.addRandomNulls(lcv);
    LongScalarSubtractLongColumn expr = new LongScalarSubtractLongColumn(100, 0, 1);
    expr.evaluate(batch);

    //verify
    for (int i=0; i < VectorizedRowBatch.DEFAULT_SIZE; i++) {
      if (!lcv.isNull[i]) {
        Assert.assertEquals(100 - i * 37, ((LongColumnVector)batch.cols[1]).vector[i]);
      } else {
        Assert.assertTrue(((LongColumnVector)batch.cols[1]).isNull[i]);
      }
    }
    Assert.assertFalse(((LongColumnVector)batch.cols[1]).noNulls);
    Assert.assertFalse(((LongColumnVector)batch.cols[1]).isRepeating);
    TestVectorArithmeticExpressions.verifyLongNullDataVectorEntries(
        (LongColumnVector) batch.cols[1], batch.selected, batch.selectedInUse, batch.size);
  }
Test vectorized expression handling for the case where there is a scalar on
the left and a column vector on the right.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorScalarColArithmetic.java