@Test
  public void testFilterExprOrExprWithBatchReuse() throws HiveException {
    VectorizedRowBatch batch1 = getBatchThreeBooleanCols();

    SelectColumnIsTrue expr1 = new SelectColumnIsTrue(0);
    SelectColumnIsFalse expr2 = new SelectColumnIsFalse(1);

    FilterExprOrExpr orExpr = new FilterExprOrExpr();
    orExpr.setChildExpressions(new VectorExpression[] {expr1, expr2});

    orExpr.evaluate(batch1);

    // Now re-initialize batch1 to simulate batch-object re-use.
    for (int i = 0; i < VectorizedRowBatch.DEFAULT_SIZE; i++) {
      batch1.selected[i] = 0;
    }
    batch1.size = BOOLEAN_COLUMN_TEST_SIZE;
    batch1.selectedInUse = false;

    // Swap column vectors to simulate change in data
    ColumnVector tmp = batch1.cols[0];
    batch1.cols[0] = batch1.cols[1];
    batch1.cols[1] = tmp;

    orExpr.evaluate(batch1);

    assertEquals(5, batch1.size);
    assertEquals(0, batch1.selected[0]);
    assertEquals(1, batch1.selected[1]);
    assertEquals(3, batch1.selected[2]);
    assertEquals(5, batch1.selected[3]);
    assertEquals(6, batch1.selected[4]);
  }
Get a batch with three boolean (long) columns.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestVectorLogicalExpressions.java