private VectorExpression getFilterOnBooleanColumnExpression(ExprNodeColumnDesc exprDesc,
      int columnNum) throws HiveException {
    final VectorExpression expr;

    // Evaluate the column as a boolean, converting if necessary.
    TypeInfo typeInfo = exprDesc.getTypeInfo();
    if (typeInfo.getCategory() == Category.PRIMITIVE &&
        ((PrimitiveTypeInfo) typeInfo).getPrimitiveCategory() == PrimitiveCategory.BOOLEAN) {
      expr = new SelectColumnIsTrue(columnNum);

      expr.setInputTypeInfos(typeInfo);
      expr.setInputDataTypePhysicalVariations(DataTypePhysicalVariation.NONE);

    } else {
      // Ok, we need to convert.
      List<ExprNodeDesc> exprAsList = Collections.singletonList(exprDesc);
      expr = getCastToBooleanExpression(exprAsList, VectorExpressionDescriptor.Mode.FILTER);
      if (expr == null) {
        throw new HiveException("Cannot vectorize converting expression " +
            exprDesc.getExprString() + " to boolean");
      }
    }
    return expr;
  }
Frees up actually marked scract columns.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java