@Test
  public void testNotExpression() throws HiveException {
    ExprNodeColumnDesc col1Expr = new ExprNodeColumnDesc(Integer.class, "col1", "table", false);
    ExprNodeConstantDesc constDesc = new ExprNodeConstantDesc(Integer.valueOf(10));

    GenericUDFOPGreaterThan udf = new GenericUDFOPGreaterThan();
    ExprNodeGenericFuncDesc greaterExprDesc = new ExprNodeGenericFuncDesc();
    greaterExprDesc.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
    greaterExprDesc.setGenericUDF(udf);
    List<ExprNodeDesc> children1 = new ArrayList<ExprNodeDesc>(2);
    children1.add(col1Expr);
    children1.add(constDesc);
    greaterExprDesc.setChildren(children1);

    ExprNodeGenericFuncDesc notExpr = new ExprNodeGenericFuncDesc();
    notExpr.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
    GenericUDFOPNot notUdf = new GenericUDFOPNot();
    notExpr.setGenericUDF(notUdf);
    List<ExprNodeDesc> childOfNot = new ArrayList<ExprNodeDesc>();
    childOfNot.add(greaterExprDesc);
    notExpr.setChildren(childOfNot);

    List<String> columns = new ArrayList<String>();
    columns.add("col0");
    columns.add("col1");
    columns.add("col2");
    VectorizationContext vc = new VectorizationContext("name", columns);

    VectorExpression ve = vc.getVectorExpression(notExpr, VectorExpressionDescriptor.Mode.FILTER);

    assertEquals(ve.getClass(), SelectColumnIsFalse.class);
    assertEquals(ve.getChildExpressions()[0].getClass(), LongColGreaterLongScalar.class);

    ve = vc.getVectorExpression(notExpr, VectorExpressionDescriptor.Mode.PROJECTION);
    assertEquals(ve.getClass(), NotCol.class);
    assertEquals(ve.getChildExpressions()[0].getClass(), LongColGreaterLongScalar.class);
  }
Create original expression tree for following
(plus (minus (plus col1 col2) col3) (multiply col4 (mod col5 col6)) )
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizationContext.java