@Test
  public void testEvaluateWithoutRun() throws Exception {
    // init udf
    Udf udf = new Udf();
    ObjectInspector[] initArguments = {queryOI, argOI, funcDefOI};
    udf.initialize(initArguments);
    //set arguments
    DeferredObject queryObj = new DeferredJavaObject("hello(:1)");
    DeferredObject argObj = new DeferredJavaObject("name");
    DeferredObject funcDef = new DeferredJavaObject(new Text("Dummy function definition"));
    DeferredObject[] argumentsObj = {queryObj, argObj, funcDef};
    Arguments args = new Arguments();
    args.parse(new String[]{"-e", "null"});
    udf.getExec().parseAndEval(args);
    udf.getExec().enterGlobalScope();
    // init exec and set parameters, included
    udf.setParameters(argumentsObj);

    // checking var exists and its value is right
    Var var = udf.getExec().findVariable(":1");
    Assert.assertNotNull(var);
    String val = (String) var.value;
    Assert.assertEquals(val, "name");
  }
test evaluate for exec init and setParameters
hplsql/src/test/java/org/apache/hive/hplsql/udf/TestHplsqlUdf.java