Skip to content

Commit

Permalink
Remove unused field from TestIcebergMetadataListing
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Dec 21, 2023
1 parent f6ea5b4 commit 6afc644
Showing 1 changed file with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,13 @@

import com.google.common.collect.ImmutableMap;
import io.trino.Session;
import io.trino.metadata.MaterializedViewDefinition;
import io.trino.metadata.QualifiedObjectName;
import io.trino.plugin.hive.TestingHivePlugin;
import io.trino.plugin.hive.metastore.HiveMetastore;
import io.trino.plugin.hive.metastore.HiveMetastoreFactory;
import io.trino.spi.connector.SchemaTableName;
import io.trino.spi.security.Identity;
import io.trino.spi.security.SelectedRole;
import io.trino.testing.AbstractTestQueryFramework;
import io.trino.testing.DistributedQueryRunner;
import io.trino.transaction.TransactionId;
import io.trino.transaction.TransactionManager;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
Expand All @@ -43,7 +38,6 @@ public class TestIcebergMetadataListing
extends AbstractTestQueryFramework
{
private HiveMetastore metastore;
private SchemaTableName storageTable;

@Override
protected DistributedQueryRunner createQueryRunner()
Expand Down Expand Up @@ -77,7 +71,6 @@ public void setUp()
assertQuerySucceeds("CREATE TABLE iceberg.test_schema.iceberg_table2 (_double DOUBLE) WITH (partitioning = ARRAY['_double'])");
assertQuerySucceeds("CREATE MATERIALIZED VIEW iceberg.test_schema.iceberg_materialized_view AS " +
"SELECT * FROM iceberg.test_schema.iceberg_table1");
storageTable = getStorageTable("iceberg", "test_schema", "iceberg_materialized_view");
assertQuerySucceeds("CREATE VIEW iceberg.test_schema.iceberg_view AS SELECT * FROM iceberg.test_schema.iceberg_table1");

assertQuerySucceeds("CREATE TABLE hive.test_schema.hive_table (_double DOUBLE)");
Expand Down Expand Up @@ -148,15 +141,4 @@ public void testTableValidation()
assertQuerySucceeds("SELECT * FROM iceberg.test_schema.iceberg_table1");
assertQueryFails("SELECT * FROM iceberg.test_schema.hive_table", "Not an Iceberg table: test_schema.hive_table");
}

private SchemaTableName getStorageTable(String catalogName, String schemaName, String objectName)
{
TransactionManager transactionManager = getQueryRunner().getTransactionManager();
TransactionId transactionId = transactionManager.beginTransaction(false);
Session session = getSession().beginTransactionId(transactionId, transactionManager, getQueryRunner().getAccessControl());
Optional<MaterializedViewDefinition> materializedView = getQueryRunner().getMetadata()
.getMaterializedView(session, new QualifiedObjectName(catalogName, schemaName, objectName));
assertThat(materializedView).isPresent();
return materializedView.get().getStorageTable().get().getSchemaTableName();
}
}

0 comments on commit 6afc644

Please sign in to comment.