Source:
<code>public void testIllegalStorageFormatDuringTableScan() { SchemaTableName schemaTableName = temporaryTable("test_illegal_storage_format"); try (Transaction transaction = newTransaction()) { ConnectorSession session = newSession(); List<Column> columns = ImmutableList.of(new Column("pk", HIVE_STRING, Optional.empty())); String tableOwner = session.getUser(); String schemaName = schemaTableName.getSchemaName(); String tableName = schemaTableName.getTableName(); <START> LocationService locationService = getLocationService(); <END> LocationHandle locationHandle = locationService.forNewTable(transaction.getMetastore(schemaName), session, schemaName, tableName); Path targetPath = locationService.getQueryWriteInfo(locationHandle).getTargetPath(); Table.Builder tableBuilder = Table.builder() .setDatabaseName(schemaName) .setTableName(tableName) .setOwner(tableOwner) .setTableType(PrestoTableType.MANAGED_TABLE) .setParameters(ImmutableMap.of( PRESTO_VERSION_NAME, TEST_SERVER_VERSION, PRESTO_QUERY_ID_NAME, session.getQueryId())) .setDataColumns(columns) .withStorage(storage -> storage .setLocation(targetPath.toString()) .setStorageFormat(StorageFormat.createNullable(null, null, null)) .setSerdeParameters(ImmutableMap.of())); PrincipalPrivileges principalPrivileges = testingPrincipalPrivilege(tableOwner, session.getUser()); transaction.getMetastore(schemaName).createTable(session, tableBuilder.build(), principalPrivileges, Optional.empty(), true, EMPTY_TABLE_STATISTICS); transaction.commit(); } try (Transaction transaction = newTransaction()) { ConnectorMetadata metadata = transaction.getMetadata(); Map<SchemaTableName, List<ColumnMetadata>> allColumns = metadata.listTableColumns(newSession(), new SchemaTablePrefix(schemaTableName.getSchemaName())); assertTrue(allColumns.containsKey(schemaTableName)); } finally { dropTable(schemaTableName); } }</code><technical_language>nit: perhaps, getLocationService() in next 2 lines remove this variable</technical_language>

Target:
public void testIllegalStorageFormatDuringTableScan() { SchemaTableName schemaTableName = temporaryTable("test_illegal_storage_format"); try (Transaction transaction = newTransaction()) { ConnectorSession session = newSession(); List<Column> columns = ImmutableList.of(new Column("pk", HIVE_STRING, Optional.empty())); String tableOwner = session.getUser(); String schemaName = schemaTableName.getSchemaName(); String tableName = schemaTableName.getTableName(); LocationHandle locationHandle = getLocationService().forNewTable(transaction.getMetastore(schemaName), session, schemaName, tableName); Path targetPath = getLocationService().getQueryWriteInfo(locationHandle).getTargetPath(); Table.Builder tableBuilder = Table.builder() .setDatabaseName(schemaName) .setTableName(tableName) .setOwner(tableOwner) .setTableType(PrestoTableType.MANAGED_TABLE) .setParameters(ImmutableMap.of( PRESTO_VERSION_NAME, TEST_SERVER_VERSION, PRESTO_QUERY_ID_NAME, session.getQueryId())) .setDataColumns(columns) .withStorage(storage -> storage .setLocation(targetPath.toString()) .setStorageFormat(StorageFormat.createNullable(null, null, null)) .setSerdeParameters(ImmutableMap.of())); PrincipalPrivileges principalPrivileges = testingPrincipalPrivilege(tableOwner, session.getUser()); transaction.getMetastore(schemaName).createTable(session, tableBuilder.build(), principalPrivileges, Optional.empty(), true, EMPTY_TABLE_STATISTICS); transaction.commit(); } try (Transaction transaction = newTransaction()) { ConnectorMetadata metadata = transaction.getMetadata(); Map<SchemaTableName, List<ColumnMetadata>> allColumns = metadata.listTableColumns(newSession(), new SchemaTablePrefix(schemaTableName.getSchemaName())); assertTrue(allColumns.containsKey(schemaTableName)); } finally { dropTable(schemaTableName); } }