@Test
  public void testUnionUniqueColumnNames() throws Exception {
    HiveStatement stmt = (HiveStatement) con.createStatement();

    stmt.execute("SET hive.resultset.use.unique.column.names=true");
    ResultSet rs = stmt.executeQuery("select 1 UNION ALL select 2");
    ResultSetMetaData metaData = rs.getMetaData();
    assertEquals("col1", metaData.getColumnLabel(1));
    assertTrue("There's no . for the UNION column name", !metaData.getColumnLabel(1).contains("."));
    stmt.close();
  }
Test {@link HiveStatement#executeAsync(String)} for an insert overwrite into a table
@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java