@SuppressWarnings("nls")
  private Operator genFilterPlan(QB qb, ASTNode condn, Operator input, boolean useCaching)
      throws SemanticException {

    OpParseContext inputCtx = opParseCtx.get(input);
    RowResolver inputRR = inputCtx.getRowResolver();

    ExprNodeDesc filterCond = genExprNodeDesc(condn, inputRR, useCaching, isCBOExecuted());
    if (filterCond instanceof ExprNodeConstantDesc) {
      ExprNodeConstantDesc c = (ExprNodeConstantDesc) filterCond;
      if (Boolean.TRUE.equals(c.getValue())) {
        // If filter condition is TRUE, we ignore it
        return input;
      }
      if (ExprNodeDescUtils.isNullConstant(c)) {
        // If filter condition is NULL, transform to FALSE
        filterCond = new ExprNodeConstantDesc(TypeInfoFactory.booleanTypeInfo, false);
      }
    }

    if (!filterCond.getTypeInfo().accept(TypeInfoFactory.booleanTypeInfo)) {
      // If the returning type of the filter condition is not boolean, try to implicitly
      // convert the result of the condition to a boolean value.
      if (filterCond.getTypeInfo().getCategory() == ObjectInspector.Category.PRIMITIVE) {
        // For primitive types like string/double/timestamp, try to cast the result of
        // the child expression to a boolean.
        filterCond = ExprNodeTypeCheck.getExprNodeDefaultExprProcessor()
            .createConversionCast(filterCond, TypeInfoFactory.booleanTypeInfo);
      } else {
        // For complex types like map/list/struct, create a isnotnull function on the child expression.
        filterCond = ExprNodeTypeCheck.getExprNodeDefaultExprProcessor()
            .getFuncExprNodeDesc("isnotnull", filterCond);
      }
    }

    Operator output = putOpInsertMap(OperatorFactory.getAndMakeChild(
        new FilterDesc(filterCond, false), new RowSchema(
            inputRR.getColumnInfos()), input), inputRR);

    ctx.getPlanMapper().link(condn, output);

    LOG.debug("Created Filter Plan for {} row schema: {}", qb.getId(), inputRR.toString());
    return output;
  }
create a filter plan. The condition and the inputs are specified.

@param qb
         current query block
@param condn
         The condition to be resolved
@param input
         the input operator
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java