diff --git a/core/trino-main/src/main/java/io/trino/split/SplitManager.java b/core/trino-main/src/main/java/io/trino/split/SplitManager.java index ab5b9bb77ea3..ba5f9cfa5dd0 100644 --- a/core/trino-main/src/main/java/io/trino/split/SplitManager.java +++ b/core/trino-main/src/main/java/io/trino/split/SplitManager.java @@ -16,19 +16,16 @@ import io.trino.Session; import io.trino.connector.CatalogName; import io.trino.execution.QueryManagerConfig; -import io.trino.metadata.Metadata; import io.trino.metadata.TableHandle; import io.trino.spi.connector.ConnectorSession; import io.trino.spi.connector.ConnectorSplitManager; import io.trino.spi.connector.ConnectorSplitManager.SplitSchedulingStrategy; import io.trino.spi.connector.ConnectorSplitSource; -import io.trino.spi.connector.ConnectorTableLayoutHandle; import io.trino.spi.connector.Constraint; import io.trino.spi.connector.DynamicFilter; import javax.inject.Inject; -import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -42,16 +39,10 @@ public class SplitManager private final ConcurrentMap splitManagers = new ConcurrentHashMap<>(); private final int minScheduleSplitBatchSize; - // NOTE: This only used for filling in the table layout if none is present by the time we - // get splits. DO NOT USE IT FOR ANY OTHER PURPOSE, as it will be removed once table layouts - // are gone entirely - private final Metadata metadata; - @Inject - public SplitManager(QueryManagerConfig config, Metadata metadata) + public SplitManager(QueryManagerConfig config) { this.minScheduleSplitBatchSize = config.getMinScheduleSplitBatchSize(); - this.metadata = metadata; } public void addConnectorSplitManager(CatalogName catalogName, ConnectorSplitManager connectorSplitManager) @@ -81,25 +72,13 @@ public SplitSource getSplits( ConnectorSession connectorSession = session.toConnectorSession(catalogName); - ConnectorSplitSource source; - if (metadata.usesLegacyTableLayouts(session, table)) { - ConnectorTableLayoutHandle layout = table.getLayout() - .orElseGet(() -> metadata.getLayout(session, table, Constraint.alwaysTrue(), Optional.empty()) - .get() - .getNewTableHandle() - .getLayout().get()); - - source = splitManager.getSplits(table.getTransaction(), connectorSession, layout, splitSchedulingStrategy); - } - else { - source = splitManager.getSplits( - table.getTransaction(), - connectorSession, - table.getConnectorHandle(), - splitSchedulingStrategy, - dynamicFilter, - constraint); - } + ConnectorSplitSource source = splitManager.getSplits( + table.getTransaction(), + connectorSession, + table.getConnectorHandle(), + splitSchedulingStrategy, + dynamicFilter, + constraint); SplitSource splitSource = new ConnectorAwareSplitSource(catalogName, source); if (minScheduleSplitBatchSize > 1) { diff --git a/core/trino-main/src/main/java/io/trino/testing/LocalQueryRunner.java b/core/trino-main/src/main/java/io/trino/testing/LocalQueryRunner.java index 1af16198edbf..85c38e2c6d1d 100644 --- a/core/trino-main/src/main/java/io/trino/testing/LocalQueryRunner.java +++ b/core/trino-main/src/main/java/io/trino/testing/LocalQueryRunner.java @@ -344,7 +344,7 @@ private LocalQueryRunner( blockEncodingSerde, nodeManager.getCurrentNode().getNodeVersion()); this.plannerContext = new PlannerContext(metadata, typeOperators, blockEncodingSerde, typeManager); - this.splitManager = new SplitManager(new QueryManagerConfig(), metadata); + this.splitManager = new SplitManager(new QueryManagerConfig()); this.planFragmenter = new PlanFragmenter(metadata, this.nodePartitioningManager, new QueryManagerConfig()); this.joinCompiler = new JoinCompiler(typeOperators); PageIndexerFactory pageIndexerFactory = new GroupByHashPageIndexerFactory(joinCompiler, blockTypeOperators); diff --git a/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java b/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java index 6d9685f722f1..10d1b8d0637b 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java +++ b/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java @@ -1022,7 +1022,6 @@ default List listTablePrivileges(ConnectorSession session, SchemaTabl * */ default boolean usesLegacyTableLayouts() diff --git a/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorSplitManager.java b/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorSplitManager.java index 9887b7debdf0..27d45bd99665 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorSplitManager.java +++ b/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorSplitManager.java @@ -15,16 +15,6 @@ public interface ConnectorSplitManager { - @Deprecated - default ConnectorSplitSource getSplits( - ConnectorTransactionHandle transactionHandle, - ConnectorSession session, - ConnectorTableLayoutHandle layout, - SplitSchedulingStrategy splitSchedulingStrategy) - { - throw new UnsupportedOperationException(); - } - @Deprecated default ConnectorSplitSource getSplits( ConnectorTransactionHandle transaction, diff --git a/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/classloader/ClassLoaderSafeConnectorSplitManager.java b/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/classloader/ClassLoaderSafeConnectorSplitManager.java index f47281251348..bf3bee3ef638 100644 --- a/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/classloader/ClassLoaderSafeConnectorSplitManager.java +++ b/lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/classloader/ClassLoaderSafeConnectorSplitManager.java @@ -18,7 +18,6 @@ import io.trino.spi.connector.ConnectorSplitManager; import io.trino.spi.connector.ConnectorSplitSource; import io.trino.spi.connector.ConnectorTableHandle; -import io.trino.spi.connector.ConnectorTableLayoutHandle; import io.trino.spi.connector.ConnectorTransactionHandle; import io.trino.spi.connector.Constraint; import io.trino.spi.connector.DynamicFilter; @@ -40,14 +39,6 @@ public ClassLoaderSafeConnectorSplitManager(@ForClassLoaderSafe ConnectorSplitMa this.classLoader = requireNonNull(classLoader, "classLoader is null"); } - @Override - public ConnectorSplitSource getSplits(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorTableLayoutHandle layout, SplitSchedulingStrategy splitSchedulingStrategy) - { - try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) { - return delegate.getSplits(transactionHandle, session, layout, splitSchedulingStrategy); - } - } - @Override public ConnectorSplitSource getSplits(ConnectorTransactionHandle transaction, ConnectorSession session, ConnectorTableHandle table, SplitSchedulingStrategy splitSchedulingStrategy, DynamicFilter dynamicFilter) {