@Test
  public void testLongColOrLongCol() throws HiveException {
    VectorizedRowBatch batch = getBatchThreeBooleanCols();
    ColOrCol expr = new ColOrCol(0, 1, 2);
    LongColumnVector outCol = (LongColumnVector) batch.cols[2];
    expr.evaluate(batch);
    // verify
    Assert.assertEquals(0, outCol.vector[0]);
    Assert.assertEquals(1, outCol.vector[1]);
    Assert.assertEquals(1, outCol.vector[2]);
    Assert.assertEquals(1, outCol.vector[3]);
    Assert.assertFalse(outCol.isNull[3]);
    Assert.assertTrue(outCol.isNull[4]);
    Assert.assertEquals(1, outCol.vector[5]);
    Assert.assertTrue(outCol.isNull[6]);
    Assert.assertEquals(1, outCol.vector[7]);
    Assert.assertTrue(outCol.isNull[8]);

    Assert.assertEquals(batch.size, 9);
    Assert.assertFalse(outCol.noNulls);
    Assert.assertFalse(outCol.isRepeating);

    // try non-null path
    batch = getBatchThreeBooleanCols();
    batch.cols[0].noNulls = true;
    batch.cols[1].noNulls = true;
    batch.cols[2].noNulls = false;
    outCol = (LongColumnVector) batch.cols[2];
    expr.evaluate(batch);

    // spot check
    Assert.assertEquals(0, outCol.vector[0]);
    Assert.assertEquals(1, outCol.vector[1]);
    Assert.assertEquals(1, outCol.vector[2]);
    Assert.assertEquals(1, outCol.vector[3]);

    // try isRepeating path (left input only), no nulls
    batch = getBatchThreeBooleanCols();
    batch.cols[0].noNulls = true;
    batch.cols[0].isRepeating = true;
    batch.cols[1].noNulls = true;
    batch.cols[1].isRepeating = false;
    batch.cols[2].noNulls = false;
    batch.cols[2].isRepeating = true;
    outCol = (LongColumnVector) batch.cols[2];
    expr.evaluate(batch);

    // spot check
    Assert.assertFalse(outCol.isRepeating);
    Assert.assertEquals(0, outCol.vector[0]);
    Assert.assertEquals(1, outCol.vector[1]);
    Assert.assertEquals(0, outCol.vector[2]);
    Assert.assertEquals(1, outCol.vector[3]);
  }
Unit tests for logical expressions AND, OR, NOT, IsNull etc.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java