@Test
  public void testNestedUdfAndProcedure() throws Throwable {
    String scriptText =
        "CREATE FUNCTION dbl(d int)\n" +
        "   RETURNS int\n" +
        "BEGIN\n" +
        "   RETURN d * 2;\n" +
        "END;\n" +
        "SELECT dbl(abs(-2)), abs(dbl(-2)), dbl(dbl(20));\n";
    testScriptFile(scriptText, args(), "4.*4\\.0.*80");
  }
Start up a local Hive Server 2 for these tests
itests/hive-unit/src/test/java/org/apache/hive/beeline/TestHplSqlViaBeeLine.java