@Test
  public void testUdfString() throws Throwable {
    String scriptText =
        "DROP TABLE IF EXISTS result;\n" +
            "CREATE TABLE result (col_s string);\n" +
            "INSERT INTO result VALUES('Alice');\n" +
            "INSERT INTO result VALUES('Smith');\n" +
            "CREATE FUNCTION hello(s string)\n" +
            "   RETURNS string\n" +
            "BEGIN\n" +
            "   RETURN 'Hello ' || s || '!';\n" +
            "END;\n" +
            "SELECT hello(col_s) FROM result ORDER BY col_s ASC;\n";
    testScriptFile(scriptText, args(), "Hello Alice!.*Hello Smith!");
  }
Start up a local Hive Server 2 for these tests
itests/hive-unit/src/test/java/org/apache/hive/beeline/TestHplSqlViaBeeLine.java