@Test
  public void testBuilderComplexTypes2() throws Exception {
    SearchArgumentImpl sarg = (SearchArgumentImpl)
        SearchArgumentFactory.newBuilder()
            .startAnd()
            .lessThan("x", PredicateLeaf.Type.DATE, Date.valueOf("2005-3-12"))
            .lessThanEquals("y", PredicateLeaf.Type.STRING,
                new HiveChar("hi", 10).toString())
            .equals("z", PredicateLeaf.Type.DECIMAL,
                new HiveDecimalWritable("1.0"))
            .end()
            .build();
    assertEquals("leaf-0 = (LESS_THAN x 2005-03-12), " +
        "leaf-1 = (LESS_THAN_EQUALS y hi        ), " +
        "leaf-2 = (EQUALS z 1), " +
        "expr = (and leaf-0 leaf-1 leaf-2)", sarg.toOldString());

    sarg = (SearchArgumentImpl) SearchArgumentFactory.newBuilder()
        .startNot()
        .startOr()
        .isNull("x", PredicateLeaf.Type.LONG)
        .between("y", PredicateLeaf.Type.DECIMAL, new HiveDecimalWritable("10"),
            new HiveDecimalWritable("20.0"))
        .in("z", PredicateLeaf.Type.LONG, 1L, 2L, 3L)
        .nullSafeEquals("a", PredicateLeaf.Type.STRING,
            new HiveVarchar("stinger", 100).toString())
        .end()
        .end()
        .build();
    assertEquals("leaf-0 = (IS_NULL x), " +
        "leaf-1 = (BETWEEN y 10 20), " +
        "leaf-2 = (IN z 1 2 3), " +
        "leaf-3 = (NULL_SAFE_EQUALS a stinger), " +
        "expr = (and (not leaf-0) (not leaf-1) (not leaf-2) (not leaf-3))",
        sarg.toOldString());
  }
Create a predicate leaf. This is used by another test.
ql/src/test/org/apache/hadoop/hive/ql/io/sarg/TestSearchArgumentImpl.java