From 0c368d20ed542044e9b163cf7f1445f5a9b70033 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Wed, 19 Jul 2023 13:11:40 +0200 Subject: [PATCH 1/5] Remove duplicate isIcebergTable method Hive and Iceberg should agree on what is and what isn't an Iceberg table, so let them use one common implementation of `isIcebergTable` method. --- .../src/main/java/io/trino/plugin/iceberg/IcebergUtil.java | 7 ------- .../catalog/hms/AbstractMetastoreTableOperations.java | 2 +- .../trino/plugin/iceberg/catalog/hms/TrinoHiveCatalog.java | 2 +- .../trino/plugin/iceberg/procedure/MigrateProcedure.java | 2 +- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergUtil.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergUtil.java index 6d413d8d72b3..64e3e18d066d 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergUtil.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergUtil.java @@ -147,8 +147,6 @@ import static java.math.RoundingMode.UNNECESSARY; import static java.util.Comparator.comparing; import static java.util.Objects.requireNonNull; -import static org.apache.iceberg.BaseMetastoreTableOperations.ICEBERG_TABLE_TYPE_VALUE; -import static org.apache.iceberg.BaseMetastoreTableOperations.TABLE_TYPE_PROP; import static org.apache.iceberg.LocationProviders.locationsFor; import static org.apache.iceberg.MetadataTableUtils.createMetadataTableInstance; import static org.apache.iceberg.TableProperties.DEFAULT_FILE_FORMAT; @@ -180,11 +178,6 @@ public final class IcebergUtil private IcebergUtil() {} - public static boolean isIcebergTable(io.trino.plugin.hive.metastore.Table table) - { - return ICEBERG_TABLE_TYPE_VALUE.equalsIgnoreCase(table.getParameters().get(TABLE_TYPE_PROP)); - } - public static Table loadIcebergTable(TrinoCatalog catalog, IcebergTableOperationsProvider tableOperationsProvider, ConnectorSession session, SchemaTableName table) { TableOperations operations = tableOperationsProvider.createTableOperations( diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/AbstractMetastoreTableOperations.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/AbstractMetastoreTableOperations.java index 0614bec88bfe..3d7291cd64e4 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/AbstractMetastoreTableOperations.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/AbstractMetastoreTableOperations.java @@ -36,8 +36,8 @@ import static io.trino.plugin.hive.ViewReaderUtil.isHiveOrPrestoView; import static io.trino.plugin.hive.ViewReaderUtil.isPrestoView; import static io.trino.plugin.hive.metastore.PrincipalPrivileges.NO_PRIVILEGES; +import static io.trino.plugin.hive.util.HiveUtil.isIcebergTable; import static io.trino.plugin.iceberg.IcebergErrorCode.ICEBERG_INVALID_METADATA; -import static io.trino.plugin.iceberg.IcebergUtil.isIcebergTable; import static java.lang.String.format; import static java.util.Locale.ENGLISH; import static java.util.Objects.requireNonNull; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/TrinoHiveCatalog.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/TrinoHiveCatalog.java index a4baf17843f1..91e3f1c6fd6e 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/TrinoHiveCatalog.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/TrinoHiveCatalog.java @@ -75,13 +75,13 @@ import static io.trino.plugin.hive.metastore.PrincipalPrivileges.NO_PRIVILEGES; import static io.trino.plugin.hive.metastore.StorageFormat.VIEW_STORAGE_FORMAT; import static io.trino.plugin.hive.util.HiveUtil.isHiveSystemSchema; +import static io.trino.plugin.hive.util.HiveUtil.isIcebergTable; import static io.trino.plugin.iceberg.IcebergMaterializedViewAdditionalProperties.STORAGE_SCHEMA; import static io.trino.plugin.iceberg.IcebergMaterializedViewDefinition.encodeMaterializedViewData; import static io.trino.plugin.iceberg.IcebergMaterializedViewDefinition.fromConnectorMaterializedViewDefinition; import static io.trino.plugin.iceberg.IcebergSchemaProperties.LOCATION_PROPERTY; import static io.trino.plugin.iceberg.IcebergSessionProperties.getHiveCatalogName; import static io.trino.plugin.iceberg.IcebergUtil.getIcebergTableWithMetadata; -import static io.trino.plugin.iceberg.IcebergUtil.isIcebergTable; import static io.trino.plugin.iceberg.IcebergUtil.loadIcebergTable; import static io.trino.plugin.iceberg.IcebergUtil.validateTableCanBeDropped; import static io.trino.plugin.iceberg.catalog.AbstractIcebergTableOperations.ICEBERG_METASTORE_STORAGE_FORMAT; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/procedure/MigrateProcedure.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/procedure/MigrateProcedure.java index 677abaf05fbe..a1a7c91d55a7 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/procedure/MigrateProcedure.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/procedure/MigrateProcedure.java @@ -90,9 +90,9 @@ import static io.trino.plugin.hive.metastore.PrincipalPrivileges.NO_PRIVILEGES; import static io.trino.plugin.hive.util.HiveUtil.isDeltaLakeTable; import static io.trino.plugin.hive.util.HiveUtil.isHudiTable; +import static io.trino.plugin.hive.util.HiveUtil.isIcebergTable; import static io.trino.plugin.iceberg.IcebergErrorCode.ICEBERG_COMMIT_ERROR; import static io.trino.plugin.iceberg.IcebergSecurityConfig.IcebergSecurity.SYSTEM; -import static io.trino.plugin.iceberg.IcebergUtil.isIcebergTable; import static io.trino.plugin.iceberg.PartitionFields.parsePartitionFields; import static io.trino.plugin.iceberg.TypeConverter.toIcebergTypeForNewColumn; import static io.trino.spi.StandardErrorCode.INVALID_PROCEDURE_ARGUMENT; From b140d261d3c8c35dd3ee011a4e9ece5ac48ecb89 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Wed, 19 Jul 2023 13:15:14 +0200 Subject: [PATCH 2/5] Simplify HiveUtil.isDeltaLakeTable Match HiveUtil.isIcebergTable in simplicity --- .../src/main/java/io/trino/plugin/hive/util/HiveUtil.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/HiveUtil.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/HiveUtil.java index eba4839b8f43..c50edd50003e 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/HiveUtil.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/util/HiveUtil.java @@ -1126,8 +1126,7 @@ public static boolean isDeltaLakeTable(Table table) public static boolean isDeltaLakeTable(Map tableParameters) { - return tableParameters.containsKey(SPARK_TABLE_PROVIDER_KEY) - && tableParameters.get(SPARK_TABLE_PROVIDER_KEY).toLowerCase(ENGLISH).equals(DELTA_LAKE_PROVIDER); + return DELTA_LAKE_PROVIDER.equalsIgnoreCase(tableParameters.get(SPARK_TABLE_PROVIDER_KEY)); } public static boolean isIcebergTable(Table table) From ad2914967f93fdbad0e05fa95c93cff88b527ee4 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Wed, 19 Jul 2023 13:15:57 +0200 Subject: [PATCH 3/5] Remove duplicate isDeltaLakeTable method --- .../DeltaLakeGlueMetastoreTableFilterProvider.java | 6 ++++-- .../DefaultGlueMetastoreTableFilterProvider.java | 12 ++---------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/metastore/glue/DeltaLakeGlueMetastoreTableFilterProvider.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/metastore/glue/DeltaLakeGlueMetastoreTableFilterProvider.java index dce37451861e..fd3e8dbd6472 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/metastore/glue/DeltaLakeGlueMetastoreTableFilterProvider.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/metastore/glue/DeltaLakeGlueMetastoreTableFilterProvider.java @@ -16,10 +16,12 @@ import com.amazonaws.services.glue.model.Table; import com.google.inject.Inject; import com.google.inject.Provider; -import io.trino.plugin.hive.metastore.glue.DefaultGlueMetastoreTableFilterProvider; +import io.trino.plugin.hive.util.HiveUtil; import java.util.function.Predicate; +import static io.trino.plugin.hive.metastore.glue.converter.GlueToTrinoConverter.getTableParameters; + public class DeltaLakeGlueMetastoreTableFilterProvider implements Provider> { @@ -35,7 +37,7 @@ public DeltaLakeGlueMetastoreTableFilterProvider(DeltaLakeGlueMetastoreConfig co public Predicate get() { if (hideNonDeltaLakeTables) { - return DefaultGlueMetastoreTableFilterProvider::isDeltaLakeTable; + return table -> HiveUtil.isDeltaLakeTable(getTableParameters(table)); } return table -> true; } diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/DefaultGlueMetastoreTableFilterProvider.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/DefaultGlueMetastoreTableFilterProvider.java index cd3e3b5324de..8e463704a527 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/DefaultGlueMetastoreTableFilterProvider.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/DefaultGlueMetastoreTableFilterProvider.java @@ -18,12 +18,10 @@ import com.google.inject.Provider; import io.trino.plugin.hive.HideDeltaLakeTables; -import java.util.Map; import java.util.function.Predicate; import static io.trino.plugin.hive.metastore.glue.converter.GlueToTrinoConverter.getTableParameters; -import static io.trino.plugin.hive.util.HiveUtil.DELTA_LAKE_PROVIDER; -import static io.trino.plugin.hive.util.HiveUtil.SPARK_TABLE_PROVIDER_KEY; +import static io.trino.plugin.hive.util.HiveUtil.isDeltaLakeTable; import static java.util.function.Predicate.not; public class DefaultGlueMetastoreTableFilterProvider @@ -41,14 +39,8 @@ public DefaultGlueMetastoreTableFilterProvider(@HideDeltaLakeTables boolean hide public Predicate
get() { if (hideDeltaLakeTables) { - return not(DefaultGlueMetastoreTableFilterProvider::isDeltaLakeTable); + return not(table -> isDeltaLakeTable(getTableParameters(table))); } return table -> true; } - - public static boolean isDeltaLakeTable(Table table) - { - Map parameters = getTableParameters(table); - return parameters.getOrDefault(SPARK_TABLE_PROVIDER_KEY, "").equalsIgnoreCase(DELTA_LAKE_PROVIDER); - } } From 4b4bb6f0b2f26f13192396d403d68d3ade4fdcfd Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Wed, 19 Jul 2023 13:25:00 +0200 Subject: [PATCH 4/5] Short-circuit HiveMetadata.redirectTable when redirects not configured --- .../io/trino/plugin/hive/HiveMetadata.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) 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 c4aaf8c97f16..d6ed2c4032be 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 @@ -3758,6 +3758,15 @@ public Optional redirectTable(ConnectorSession session, { requireNonNull(session, "session is null"); requireNonNull(tableName, "tableName is null"); + + Optional icebergCatalogName = getIcebergCatalogName(session); + Optional deltaLakeCatalogName = getDeltaLakeCatalogName(session); + Optional hudiCatalogName = getHudiCatalogName(session); + + if (icebergCatalogName.isEmpty() && deltaLakeCatalogName.isEmpty() && hudiCatalogName.isEmpty()) { + return Optional.empty(); + } + if (isHiveSystemSchema(tableName.getSchemaName())) { return Optional.empty(); } @@ -3768,9 +3777,10 @@ public Optional redirectTable(ConnectorSession session, return Optional.empty(); } - Optional catalogSchemaTableName = redirectTableToIceberg(session, table.get()) - .or(() -> redirectTableToDeltaLake(session, table.get())) - .or(() -> redirectTableToHudi(session, table.get())); + Optional catalogSchemaTableName = Optional.empty() + .or(() -> redirectTableToIceberg(icebergCatalogName, table.get())) + .or(() -> redirectTableToDeltaLake(deltaLakeCatalogName, table.get())) + .or(() -> redirectTableToHudi(hudiCatalogName, table.get())); // stitch back the suffix we cut off. return catalogSchemaTableName.map(name -> new CatalogSchemaTableName( @@ -3780,9 +3790,8 @@ public Optional redirectTable(ConnectorSession session, name.getSchemaTableName().getTableName() + tableNameSplit.getSuffix().orElse("")))); } - private Optional redirectTableToIceberg(ConnectorSession session, Table table) + private Optional redirectTableToIceberg(Optional targetCatalogName, Table table) { - Optional targetCatalogName = getIcebergCatalogName(session); if (targetCatalogName.isEmpty()) { return Optional.empty(); } @@ -3792,9 +3801,8 @@ private Optional redirectTableToIceberg(ConnectorSession return Optional.empty(); } - private Optional redirectTableToDeltaLake(ConnectorSession session, Table table) + private Optional redirectTableToDeltaLake(Optional targetCatalogName, Table table) { - Optional targetCatalogName = getDeltaLakeCatalogName(session); if (targetCatalogName.isEmpty()) { return Optional.empty(); } @@ -3804,9 +3812,8 @@ private Optional redirectTableToDeltaLake(ConnectorSessi return Optional.empty(); } - private Optional redirectTableToHudi(ConnectorSession session, Table table) + private Optional redirectTableToHudi(Optional targetCatalogName, Table table) { - Optional targetCatalogName = getHudiCatalogName(session); if (targetCatalogName.isEmpty()) { return Optional.empty(); } From 620e9cb9c9edd91ffd8b4003c5b14d1fc9c312a2 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Wed, 19 Jul 2023 13:27:38 +0200 Subject: [PATCH 5/5] Short-circuit IcebergMetadata.redirectTable when redirects not configured --- .../java/io/trino/plugin/iceberg/IcebergMetadata.java | 7 ++++++- .../io/trino/plugin/iceberg/catalog/TrinoCatalog.java | 2 +- .../plugin/iceberg/catalog/glue/TrinoGlueCatalog.java | 11 ++++------- .../plugin/iceberg/catalog/hms/TrinoHiveCatalog.java | 11 ++++------- .../plugin/iceberg/catalog/jdbc/TrinoJdbcCatalog.java | 2 +- .../iceberg/catalog/nessie/TrinoNessieCatalog.java | 2 +- .../plugin/iceberg/catalog/rest/TrinoRestCatalog.java | 2 +- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java index aa089b337f1b..3bc3cb118cdf 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java @@ -207,6 +207,7 @@ import static io.trino.plugin.iceberg.IcebergMetadataColumn.FILE_PATH; import static io.trino.plugin.iceberg.IcebergMetadataColumn.isMetadataColumnId; import static io.trino.plugin.iceberg.IcebergSessionProperties.getExpireSnapshotMinRetention; +import static io.trino.plugin.iceberg.IcebergSessionProperties.getHiveCatalogName; import static io.trino.plugin.iceberg.IcebergSessionProperties.getRemoveOrphanFilesMinRetention; import static io.trino.plugin.iceberg.IcebergSessionProperties.isCollectExtendedStatisticsOnWrite; import static io.trino.plugin.iceberg.IcebergSessionProperties.isExtendedStatisticsEnabled; @@ -2879,7 +2880,11 @@ public void setColumnComment(ConnectorSession session, ConnectorTableHandle tabl @Override public Optional redirectTable(ConnectorSession session, SchemaTableName tableName) { - return catalog.redirectTable(session, tableName); + Optional targetCatalogName = getHiveCatalogName(session); + if (targetCatalogName.isEmpty()) { + return Optional.empty(); + } + return catalog.redirectTable(session, tableName, targetCatalogName.get()); } private static CollectedStatistics processComputedTableStatistics(Table table, Collection computedStatistics) diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/TrinoCatalog.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/TrinoCatalog.java index 7356bfc86631..540a138461fc 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/TrinoCatalog.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/TrinoCatalog.java @@ -136,5 +136,5 @@ void createMaterializedView( void updateColumnComment(ConnectorSession session, SchemaTableName schemaTableName, ColumnIdentity columnIdentity, Optional comment); - Optional redirectTable(ConnectorSession session, SchemaTableName tableName); + Optional redirectTable(ConnectorSession session, SchemaTableName tableName, String hiveCatalogName); } diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java index a2e63378e892..ee06343c23e3 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/glue/TrinoGlueCatalog.java @@ -102,7 +102,6 @@ import static io.trino.plugin.iceberg.IcebergMaterializedViewDefinition.encodeMaterializedViewData; import static io.trino.plugin.iceberg.IcebergMaterializedViewDefinition.fromConnectorMaterializedViewDefinition; import static io.trino.plugin.iceberg.IcebergSchemaProperties.LOCATION_PROPERTY; -import static io.trino.plugin.iceberg.IcebergSessionProperties.getHiveCatalogName; import static io.trino.plugin.iceberg.IcebergUtil.getIcebergTableWithMetadata; import static io.trino.plugin.iceberg.IcebergUtil.quotedTableName; import static io.trino.plugin.iceberg.IcebergUtil.validateTableCanBeDropped; @@ -1019,14 +1018,12 @@ public void renameMaterializedView(ConnectorSession session, SchemaTableName sou } @Override - public Optional redirectTable(ConnectorSession session, SchemaTableName tableName) + public Optional redirectTable(ConnectorSession session, SchemaTableName tableName, String hiveCatalogName) { requireNonNull(session, "session is null"); requireNonNull(tableName, "tableName is null"); - Optional targetCatalogName = getHiveCatalogName(session); - if (targetCatalogName.isEmpty()) { - return Optional.empty(); - } + requireNonNull(hiveCatalogName, "hiveCatalogName is null"); + if (isHiveSystemSchema(tableName.getSchemaName())) { return Optional.empty(); } @@ -1044,7 +1041,7 @@ public Optional redirectTable(ConnectorSession session, } if (!isIcebergTable(getTableParameters(table.get()))) { // After redirecting, use the original table name, with "$partitions" and similar suffixes - return targetCatalogName.map(catalog -> new CatalogSchemaTableName(catalog, tableName)); + return Optional.of(new CatalogSchemaTableName(hiveCatalogName, tableName)); } return Optional.empty(); } diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/TrinoHiveCatalog.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/TrinoHiveCatalog.java index 91e3f1c6fd6e..dcb9866c2f79 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/TrinoHiveCatalog.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/hms/TrinoHiveCatalog.java @@ -80,7 +80,6 @@ import static io.trino.plugin.iceberg.IcebergMaterializedViewDefinition.encodeMaterializedViewData; import static io.trino.plugin.iceberg.IcebergMaterializedViewDefinition.fromConnectorMaterializedViewDefinition; import static io.trino.plugin.iceberg.IcebergSchemaProperties.LOCATION_PROPERTY; -import static io.trino.plugin.iceberg.IcebergSessionProperties.getHiveCatalogName; import static io.trino.plugin.iceberg.IcebergUtil.getIcebergTableWithMetadata; import static io.trino.plugin.iceberg.IcebergUtil.loadIcebergTable; import static io.trino.plugin.iceberg.IcebergUtil.validateTableCanBeDropped; @@ -603,14 +602,12 @@ private List listNamespaces(ConnectorSession session, Optional n } @Override - public Optional redirectTable(ConnectorSession session, SchemaTableName tableName) + public Optional redirectTable(ConnectorSession session, SchemaTableName tableName, String hiveCatalogName) { requireNonNull(session, "session is null"); requireNonNull(tableName, "tableName is null"); - Optional targetCatalogName = getHiveCatalogName(session); - if (targetCatalogName.isEmpty()) { - return Optional.empty(); - } + requireNonNull(hiveCatalogName, "hiveCatalogName is null"); + if (isHiveSystemSchema(tableName.getSchemaName())) { return Optional.empty(); } @@ -628,7 +625,7 @@ public Optional redirectTable(ConnectorSession session, } if (!isIcebergTable(table.get())) { // After redirecting, use the original table name, with "$partitions" and similar suffixes - return targetCatalogName.map(catalog -> new CatalogSchemaTableName(catalog, tableName)); + return Optional.of(new CatalogSchemaTableName(hiveCatalogName, tableName)); } return Optional.empty(); } diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/jdbc/TrinoJdbcCatalog.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/jdbc/TrinoJdbcCatalog.java index 783866d227f9..93c53ca75fc5 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/jdbc/TrinoJdbcCatalog.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/jdbc/TrinoJdbcCatalog.java @@ -380,7 +380,7 @@ public void renameMaterializedView(ConnectorSession session, SchemaTableName sou } @Override - public Optional redirectTable(ConnectorSession session, SchemaTableName tableName) + public Optional redirectTable(ConnectorSession session, SchemaTableName tableName, String hiveCatalogName) { return Optional.empty(); } diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/TrinoNessieCatalog.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/TrinoNessieCatalog.java index e3889c119ea5..fbc56cc73419 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/TrinoNessieCatalog.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/TrinoNessieCatalog.java @@ -349,7 +349,7 @@ public void renameMaterializedView(ConnectorSession session, SchemaTableName sou } @Override - public Optional redirectTable(ConnectorSession session, SchemaTableName tableName) + public Optional redirectTable(ConnectorSession session, SchemaTableName tableName, String hiveCatalogName) { return Optional.empty(); } diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoRestCatalog.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoRestCatalog.java index 3f30343e54d0..fc44482ce592 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoRestCatalog.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/rest/TrinoRestCatalog.java @@ -390,7 +390,7 @@ public void updateColumnComment(ConnectorSession session, SchemaTableName schema } @Override - public Optional redirectTable(ConnectorSession session, SchemaTableName tableName) + public Optional redirectTable(ConnectorSession session, SchemaTableName tableName, String hiveCatalogName) { return Optional.empty(); }