@Test
    public void testCreateTablesInAlterDBSetDefaultTableType() throws Exception {
        String altered_db = "altered_db";
        runStatementOnDriver("create database "+altered_db);
        runStatementOnDriver("use "+altered_db);

        runStatementOnDriver("create table " + TableNames.TRANSACTIONALTBL6 + " (id int, name string)");
        Table managed_table_6 = client.getTable(altered_db, TableNames.TRANSACTIONALTBL6.toString());
        assertEquals("Created table type is expected to be managed but found to be external", managed_table_6.getTableType(), table_type_managed);

        runStatementOnDriver("alter database " + altered_db + " set DBPROPERTIES (\"defaultTableType\"=\"EXTERNAL\")");

        runStatementOnDriver("create table " + TableNames.EXTERNALTABLE5 + " (id int, name string)");
        Table external_table_5 = client.getTable(altered_db, TableNames.EXTERNALTABLE5.toString());
        assertEquals("Created table type is expected to be managed but found to be external", external_table_5.getTableType(), table_type_external);

        runStatementOnDriver("drop database " + altered_db + " cascade");
        LOG.info("Test execution complete:testAlterExternalTables");
    }
Tests the TestDatabaseTableDefault.testCreateTablesInAlterDBSetDefaultTableType method for creating external tables in altered database.
@throws Exception If there is an error creating managed tables
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/TestDatabaseTableDefault.java