diff --git a/src/test/java/com/exasol/adapter/dialects/exasol/AbstractExasolSqlDialectIT.java b/src/test/java/com/exasol/adapter/dialects/exasol/AbstractExasolSqlDialectIT.java index bdc9f1f..07054e9 100644 --- a/src/test/java/com/exasol/adapter/dialects/exasol/AbstractExasolSqlDialectIT.java +++ b/src/test/java/com/exasol/adapter/dialects/exasol/AbstractExasolSqlDialectIT.java @@ -892,15 +892,13 @@ void testGroupByWithColumnNumber() throws SQLException { void joinHashtypeTables() throws java.sql.SQLException { final Table virtualTable = sourceSchema.createTableBuilder("VIRTUAL").column("VHASH", "HASHTYPE(16 BYTE)") .build(); - final Table realTable = objectFactory.createSchema("OTHER").createTableBuilder("REAL") - .column("RHASH", "HASHTYPE(16 BYTE)").build(); - final VirtualSchema virtualSchema = createVirtualSchema(this.sourceSchema); - try { + try (final ExasolSchema otherSchema = objectFactory.createSchema("OTHER"); + final Table otherTable = otherSchema.createTableBuilder("REAL").column("RHASH", "HASHTYPE(16 BYTE)") + .build(); + final VirtualSchema virtualSchema = createVirtualSchema(this.sourceSchema)) { final String sql = "select * from " + virtualSchema.getFullyQualifiedName() + "." + virtualTable.getName() - + " INNER JOIN " + realTable.getFullyQualifiedName() + " ON VHASH = RHASH"; + + " INNER JOIN " + otherTable.getFullyQualifiedName() + " ON VHASH = RHASH"; assertThat(query(sql), table("HASHTYPE", "HASHTYPE").matches()); - } finally { - virtualSchema.drop(); } }