public void conditionalEvaluate(VectorizedRowBatch batch, VectorExpression condVecExpr,
      int[] condSelected, int condSize) throws HiveException {

    int saveSize = batch.size;
    boolean saveSelectedInUse = batch.selectedInUse;
    int[] saveSelected = batch.selected;

    batch.size = condSize;
    batch.selectedInUse = true;
    batch.selected = condSelected;

    condVecExpr.evaluate(batch);

    batch.size = saveSize;
    batch.selectedInUse = saveSelectedInUse;
    batch.selected = saveSelected;
  }
Base class that supports conditional execution of the THEN/ELSE vector expressions of
a SQL IF statement.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/IfExprCondExprBase.java