@Test
  public void testScalarLongDivide() throws HiveException {
    VectorizedRowBatch batch =
        TestVectorArithmeticExpressions.getVectorizedRowBatch2LongInDoubleOut();
    LongScalarDivideLongColumn expr = new LongScalarDivideLongColumn(100, 0, 2);
    batch.cols[0].isNull[1] = true;
    batch.cols[0].noNulls = false;
    DoubleColumnVector out = (DoubleColumnVector) batch.cols[2];
    out.noNulls = true;     // set now so we can verify it changed
    out.isRepeating = true;
    expr.evaluate(batch);

    // verify zero-divide result for position 0
    assertTrue(out.isNull[0]);
    assertTrue(Double.isNaN(out.vector[0]));

    // verify NULL output in entry 1 is correct
    assertTrue(out.isNull[1]);
    assertTrue(Double.isNaN(out.vector[1]));

    // check entries beyond 2nd one
    for (int i = 2; i != batch.size; i++) {
      assertTrue(equalsWithinTolerance(100d / (i * 37), out.vector[i]));
    }
    assertFalse(out.noNulls);
    assertFalse(out.isRepeating);
  }
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