@Test
  public void testBooleanSarg() throws Exception {
    ExprNodeDesc column1 =
        new ExprNodeColumnDesc(TypeInfoFactory.booleanTypeInfo, "b1", null, false);
    ExprNodeDesc column2 =
        new ExprNodeColumnDesc(TypeInfoFactory.booleanTypeInfo, "b2", null, false);
    ExprNodeDesc constant = new ExprNodeConstantDesc(TypeInfoFactory.booleanTypeInfo, true);

    ExprNodeGenericFuncDesc function1 = new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo,
        new GenericUDFOPEqual(), Lists.newArrayList(column1, constant));
    ExprNodeGenericFuncDesc function2 = new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo,
        new GenericUDFOPEqual(), Lists.newArrayList(column2, constant));

    List<ExprNodeDesc> children = Lists.newArrayList();

    children.add(function1);
    children.add(function2);
    ExprNodeGenericFuncDesc node = new ExprNodeGenericFuncDesc(TypeInfoFactory.booleanTypeInfo,
        new GenericUDFOPAnd(), children);
    String serialAst = SerializationUtilities.serializeExpression(node);

    ConvertAstToSearchArg convertAstToSearchArg = new ConvertAstToSearchArg(conf, SerializationUtilities.deserializeExpression(serialAst));
    assertFalse(convertAstToSearchArg.isPartial());
    SearchArgument sarg = convertAstToSearchArg.buildSearchArgument();
    assertEquals("(and leaf-0 leaf-1)", sarg.getExpression().toOldString());
    assertEquals(2, sarg.getLeaves().size());
    PredicateLeaf leaf = sarg.getLeaves().get(0);
    assertEquals(PredicateLeaf.Type.BOOLEAN, leaf.getType());
    assertEquals("(EQUALS b1 true)", leaf.toString());
    leaf = sarg.getLeaves().get(1);
    assertEquals(PredicateLeaf.Type.BOOLEAN, leaf.getType());
    assertEquals("(EQUALS b2 true)", leaf.toString());
  }
These tests cover the conversion from Hive's AST to SearchArguments.
ql/src/test/org/apache/hadoop/hive/ql/io/sarg/TestConvertAstToSearchArg.java