@Test
  public void testTableTypeCustom() throws Throwable {
    String scriptText =
            "DROP TABLE IF EXISTS result;\n" +
            "CREATE TABLE result (s string);\n" +
            "DROP TABLE IF EXISTS emp;\n" +
            "CREATE TABLE emp (name string);\n" +
            "INSERT INTO emp VALUES('bob');\n" +
            "TYPE my_type1 IS TABLE OF STRING INDEX BY BINARY_INTEGER;\n" +
            "DECLARE my_table1 my_type1;\n" +
            "DECLARE my_table2 my_type1;\n" +
            "SELECT name INTO my_table1(100) FROM emp;\n" +
            "my_table2(101) := 'alice';\n" +
            "INSERT INTO result VALUES(my_table1(100) || ' ' ||  my_table2(101));\n" +
            "SELECT * FROM result;\n";
    testScriptFile(scriptText, args(), "bob alice");
  }
Start up a local Hive Server 2 for these tests
itests/hive-unit/src/test/java/org/apache/hive/beeline/TestHplSqlViaBeeLine.java