diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeModule.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeModule.java index c93e1809d904..3026b015b3e4 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeModule.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeModule.java @@ -22,7 +22,6 @@ import com.google.inject.multibindings.Multibinder; import io.airlift.configuration.AbstractConfigurationAwareModule; import io.trino.filesystem.cache.CacheKeyProvider; -import io.trino.plugin.base.connector.SystemTableProvider; import io.trino.plugin.base.security.ConnectorAccessControlModule; import io.trino.plugin.base.session.SessionPropertiesProvider; import io.trino.plugin.deltalake.cache.DeltaLakeCacheKeyProvider; @@ -50,6 +49,7 @@ import io.trino.plugin.deltalake.transactionlog.writer.TransactionLogWriterFactory; import io.trino.plugin.hive.FileFormatDataSourceStats; import io.trino.plugin.hive.PropertiesSystemTableProvider; +import io.trino.plugin.hive.SystemTableProvider; import io.trino.plugin.hive.metastore.thrift.TranslateHiveViews; import io.trino.plugin.hive.parquet.ParquetReaderConfig; import io.trino.plugin.hive.parquet.ParquetWriterConfig; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveConnectorFactory.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveConnectorFactory.java index 503b2443cd0f..4fcc498fa561 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveConnectorFactory.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveConnectorFactory.java @@ -33,7 +33,6 @@ import io.trino.plugin.base.classloader.ClassLoaderSafeConnectorPageSourceProvider; import io.trino.plugin.base.classloader.ClassLoaderSafeConnectorSplitManager; import io.trino.plugin.base.classloader.ClassLoaderSafeNodePartitioningProvider; -import io.trino.plugin.base.connector.SystemTableProvider; import io.trino.plugin.base.jmx.ConnectorObjectNameGeneratorModule; import io.trino.plugin.base.jmx.MBeanServerModule; import io.trino.plugin.base.session.SessionPropertiesProvider; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadata.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadata.java index c38ad6cfcefd..46f4a9c0a1a1 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadata.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadata.java @@ -48,7 +48,6 @@ import io.trino.metastore.StorageFormat; import io.trino.metastore.Table; import io.trino.metastore.TableInfo; -import io.trino.plugin.base.connector.SystemTableProvider; import io.trino.plugin.base.projection.ApplyProjectionUtil; import io.trino.plugin.base.projection.ApplyProjectionUtil.ProjectedColumnRepresentation; import io.trino.plugin.hive.HiveSessionProperties.InsertExistingPartitionsBehavior; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadataFactory.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadataFactory.java index 198f9f69fbdc..0f46aee01f12 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadataFactory.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadataFactory.java @@ -20,7 +20,6 @@ import io.airlift.units.Duration; import io.trino.filesystem.TrinoFileSystemFactory; import io.trino.metastore.HiveMetastore; -import io.trino.plugin.base.connector.SystemTableProvider; import io.trino.plugin.hive.fs.DirectoryLister; import io.trino.plugin.hive.fs.TransactionScopeCachingDirectoryListerFactory; import io.trino.plugin.hive.metastore.HiveMetastoreConfig; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveModule.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveModule.java index 5d82949397dc..af24f09cc109 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveModule.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveModule.java @@ -22,7 +22,6 @@ import com.google.inject.Singleton; import com.google.inject.multibindings.Multibinder; import io.airlift.event.client.EventClient; -import io.trino.plugin.base.connector.SystemTableProvider; import io.trino.plugin.hive.avro.AvroFileWriterFactory; import io.trino.plugin.hive.avro.AvroPageSourceFactory; import io.trino.plugin.hive.fs.CachingDirectoryLister; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/PartitionsSystemTableProvider.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/PartitionsSystemTableProvider.java index e878636ddd68..0706404cfec9 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/PartitionsSystemTableProvider.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/PartitionsSystemTableProvider.java @@ -15,9 +15,7 @@ import com.google.inject.Inject; import io.trino.metastore.Table; -import io.trino.plugin.base.connector.SystemTableProvider; import io.trino.spi.connector.ColumnMetadata; -import io.trino.spi.connector.ConnectorMetadata; import io.trino.spi.connector.ConnectorSession; import io.trino.spi.connector.ConnectorTableMetadata; import io.trino.spi.connector.Constraint; @@ -69,9 +67,8 @@ public Optional getSourceTableName(SchemaTableName tableName) } @Override - public Optional getSystemTable(ConnectorMetadata connectorMetadata, ConnectorSession session, SchemaTableName tableName) + public Optional getSystemTable(HiveMetadata metadata, ConnectorSession session, SchemaTableName tableName) { - HiveMetadata metadata = (HiveMetadata) connectorMetadata; if (!PARTITIONS.matches(tableName)) { return Optional.empty(); } diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/PropertiesSystemTableProvider.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/PropertiesSystemTableProvider.java index a9e3665002d0..1abccf410252 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/PropertiesSystemTableProvider.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/PropertiesSystemTableProvider.java @@ -16,9 +16,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSortedMap; import io.trino.metastore.Table; -import io.trino.plugin.base.connector.SystemTableProvider; import io.trino.spi.connector.ColumnMetadata; -import io.trino.spi.connector.ConnectorMetadata; import io.trino.spi.connector.ConnectorSession; import io.trino.spi.connector.ConnectorTableMetadata; import io.trino.spi.connector.InMemoryRecordSet; @@ -52,9 +50,8 @@ public Optional getSourceTableName(SchemaTableName tableName) } @Override - public Optional getSystemTable(ConnectorMetadata connectorMetadata, ConnectorSession session, SchemaTableName tableName) + public Optional getSystemTable(HiveMetadata metadata, ConnectorSession session, SchemaTableName tableName) { - HiveMetadata metadata = (HiveMetadata) connectorMetadata; if (!PROPERTIES.matches(tableName)) { return Optional.empty(); } diff --git a/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/connector/SystemTableProvider.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/SystemTableProvider.java similarity index 79% rename from lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/connector/SystemTableProvider.java rename to plugin/trino-hive/src/main/java/io/trino/plugin/hive/SystemTableProvider.java index 5f95dd50bf5c..0ae51c91db15 100644 --- a/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/connector/SystemTableProvider.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/SystemTableProvider.java @@ -11,9 +11,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.trino.plugin.base.connector; +package io.trino.plugin.hive; -import io.trino.spi.connector.ConnectorMetadata; import io.trino.spi.connector.ConnectorSession; import io.trino.spi.connector.SchemaTableName; import io.trino.spi.connector.SystemTable; @@ -24,5 +23,5 @@ public interface SystemTableProvider { Optional getSourceTableName(SchemaTableName table); - Optional getSystemTable(ConnectorMetadata metadata, ConnectorSession session, SchemaTableName tableName); + Optional getSystemTable(HiveMetadata metadata, ConnectorSession session, SchemaTableName tableName); } diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/security/SystemTableAwareAccessControl.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/security/SystemTableAwareAccessControl.java index 6c15a05a1603..c9a1a32c2806 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/security/SystemTableAwareAccessControl.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/security/SystemTableAwareAccessControl.java @@ -17,8 +17,8 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.inject.Inject; -import io.trino.plugin.base.connector.SystemTableProvider; import io.trino.plugin.base.security.ForwardingConnectorAccessControl; +import io.trino.plugin.hive.SystemTableProvider; import io.trino.spi.connector.ConnectorAccessControl; import io.trino.spi.connector.ConnectorSecurityContext; import io.trino.spi.connector.SchemaTableName; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/SystemTables.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/SystemTables.java index b2bf5ff1564a..8ca52182b1a2 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/SystemTables.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/SystemTables.java @@ -14,7 +14,7 @@ package io.trino.plugin.hive.util; -import io.trino.plugin.base.connector.SystemTableProvider; +import io.trino.plugin.hive.SystemTableProvider; import io.trino.spi.connector.ConnectorSession; import io.trino.spi.connector.ConnectorTableMetadata; import io.trino.spi.connector.ConnectorTransactionHandle;