@Test
  public void testLongColModuloLongColumn() throws HiveException {
    VectorizedRowBatch batch = getVectorizedRowBatch2LongInLongOut();
    LongColModuloLongColumn expr = new LongColModuloLongColumn(0, 1, 2);
    batch.cols[0].isNull[1] = true;
    batch.cols[0].noNulls = false;
    batch.cols[1].noNulls = false;
    LongColumnVector out = (LongColumnVector) batch.cols[2];

    // Set so we can verify they are reset by operation
    out.noNulls = true;
    out.isRepeating = true;

    expr.evaluate(batch);

    // 0/0 for entry 0 should be set as NULL
    assertFalse(out.noNulls);
    assertTrue(out.isNull[0]);

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

    // check entries beyond first 2
    for (int i = 2; i != batch.size; i++) {
      assertTrue(out.vector[i] == 0L);
    }
    assertFalse(out.noNulls);
    assertFalse(out.isRepeating);
  }
Unit tests for vectorized arithmetic expressions.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorArithmeticExpressions.java