@Test
  public void testExprNodeBetweenWithDynamicValue() {
    ExprNodeDesc notBetween = new ExprNodeConstantDesc(TypeInfoFactory.booleanTypeInfo, Boolean.FALSE);
    ExprNodeColumnDesc colExpr = new ExprNodeColumnDesc(String.class, "col1", "table", false);
    ExprNodeDesc minExpr = new ExprNodeDynamicValueDesc(new DynamicValue("id1", TypeInfoFactory.stringTypeInfo));
    ExprNodeDesc maxExpr = new ExprNodeDynamicValueDesc(new DynamicValue("id2", TypeInfoFactory.stringTypeInfo));

    ExprNodeGenericFuncDesc betweenExpr = new ExprNodeGenericFuncDesc();
    GenericUDF betweenUdf = new GenericUDFBetween();
    betweenExpr.setTypeInfo(TypeInfoFactory.booleanTypeInfo);
    betweenExpr.setGenericUDF(betweenUdf);
    List<ExprNodeDesc> children1 = new ArrayList<ExprNodeDesc>(2);
    children1.add(notBetween);
    children1.add(colExpr);
    children1.add(minExpr);
    children1.add(maxExpr);
    betweenExpr.setChildren(children1);

    Vectorizer v = new Vectorizer();
    v.testSetCurrentBaseWork(new MapWork());
    boolean valid = v.validateExprNodeDesc(betweenExpr, "Test", Mode.FILTER, false);
    Assert.assertTrue(valid);
  }
testValidateSMBJoinOperator validates that the SMB join operator can be vectorized.
ql/src/test/org/apache/hadoop/hive/ql/optimizer/physical/TestVectorizer.java