diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/HiveMetastoreRecording.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/HiveMetastoreRecording.java index bca1586396b4..83b3809e9c87 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/HiveMetastoreRecording.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/HiveMetastoreRecording.java @@ -35,7 +35,6 @@ import io.trino.plugin.hive.metastore.UserTableKey; import io.trino.spi.TrinoException; import io.trino.spi.security.RoleGrant; -import io.trino.spi.statistics.ColumnStatisticType; import org.weakref.jmx.Managed; import javax.annotation.concurrent.Immutable; @@ -70,7 +69,6 @@ public class HiveMetastoreRecording private volatile Optional> allRoles = Optional.empty(); private final NonEvictableCache> databaseCache; private final NonEvictableCache> tableCache; - private final NonEvictableCache> supportedColumnStatisticsCache; private final NonEvictableCache tableStatisticsCache; private final NonEvictableCache partitionStatisticsCache; private final NonEvictableCache> allTablesCache; @@ -95,7 +93,6 @@ public HiveMetastoreRecording(RecordingMetastoreConfig config, JsonCodec getTable(HiveTableName hiveTableName, Supplier getSupportedColumnStatistics(String type, Supplier> valueSupplier) - { - return loadValue(supportedColumnStatisticsCache, type, valueSupplier); - } - public PartitionStatistics getTableStatistics(HiveTableName hiveTableName, Supplier valueSupplier) { return loadValue(tableStatisticsCache, hiveTableName, valueSupplier); @@ -262,7 +253,6 @@ public void writeRecording() allRoles, toPairs(databaseCache), toPairs(tableCache), - toPairs(supportedColumnStatisticsCache), toPairs(tableStatisticsCache), toPairs(partitionStatisticsCache), toPairs(allTablesCache), @@ -331,7 +321,6 @@ public static class Recording private final Optional> allRoles; private final List>> databases; private final List>> tables; - private final List>> supportedColumnStatistics; private final List> tableStatistics; private final List> partitionStatistics; private final List>> allTables; @@ -351,7 +340,6 @@ public Recording( @JsonProperty("allRoles") Optional> allRoles, @JsonProperty("databases") List>> databases, @JsonProperty("tables") List>> tables, - @JsonProperty("supportedColumnStatistics") List>> supportedColumnStatistics, @JsonProperty("tableStatistics") List> tableStatistics, @JsonProperty("partitionStatistics") List> partitionStatistics, @JsonProperty("allTables") List>> allTables, @@ -369,7 +357,6 @@ public Recording( this.allRoles = allRoles; this.databases = databases; this.tables = tables; - this.supportedColumnStatistics = supportedColumnStatistics; this.tableStatistics = tableStatistics; this.partitionStatistics = partitionStatistics; this.allTables = allTables; @@ -414,12 +401,6 @@ public List>> getTablesWithParame return tablesWithParameter; } - @JsonProperty - public List>> getSupportedColumnStatistics() - { - return supportedColumnStatistics; - } - @JsonProperty public List> getTableStatistics() { diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/RecordingHiveMetastore.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/RecordingHiveMetastore.java index 4923df5464a9..46fab470d6ce 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/RecordingHiveMetastore.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/RecordingHiveMetastore.java @@ -78,7 +78,8 @@ public Optional getTable(String databaseName, String tableName) @Override public Set getSupportedColumnStatistics(Type type) { - return recording.getSupportedColumnStatistics(type.getTypeSignature().toString(), () -> delegate.getSupportedColumnStatistics(type)); + // No need to record that, since it's a pure local operation. + return delegate.getSupportedColumnStatistics(type); } @Override diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/recording/TestRecordingHiveMetastore.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/recording/TestRecordingHiveMetastore.java index 97c44abd4e7f..1b0f07b9835d 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/recording/TestRecordingHiveMetastore.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/recording/TestRecordingHiveMetastore.java @@ -49,7 +49,6 @@ import io.trino.spi.predicate.TupleDomain; import io.trino.spi.security.RoleGrant; import io.trino.spi.security.TrinoPrincipal; -import io.trino.spi.statistics.ColumnStatisticType; import io.trino.spi.type.TestingTypeManager; import io.trino.spi.type.Type; import org.testng.annotations.Test; @@ -66,10 +65,7 @@ import static io.trino.plugin.hive.HiveBasicStatistics.createEmptyStatistics; import static io.trino.plugin.hive.util.HiveBucketing.BucketingVersion.BUCKETING_V1; import static io.trino.spi.security.PrincipalType.USER; -import static io.trino.spi.statistics.ColumnStatisticType.MAX_VALUE; -import static io.trino.spi.statistics.ColumnStatisticType.MIN_VALUE; import static io.trino.spi.type.VarcharType.createUnboundedVarcharType; -import static io.trino.spi.type.VarcharType.createVarcharType; import static org.testng.Assert.assertEquals; public class TestRecordingHiveMetastore @@ -181,7 +177,6 @@ private void validateMetadata(HiveMetastore hiveMetastore) assertEquals(hiveMetastore.getDatabase("database"), Optional.of(DATABASE)); assertEquals(hiveMetastore.getAllDatabases(), ImmutableList.of("database")); assertEquals(hiveMetastore.getTable("database", "table"), Optional.of(TABLE)); - assertEquals(hiveMetastore.getSupportedColumnStatistics(createVarcharType(123)), ImmutableSet.of(MIN_VALUE, MAX_VALUE)); assertEquals(hiveMetastore.getTableStatistics(TABLE), PARTITION_STATISTICS); assertEquals(hiveMetastore.getPartitionStatistics(TABLE, ImmutableList.of(PARTITION, OTHER_PARTITION)), ImmutableMap.of( "column=value", PARTITION_STATISTICS, @@ -238,16 +233,6 @@ public Optional
getTable(String databaseName, String tableName) return Optional.empty(); } - @Override - public Set getSupportedColumnStatistics(Type type) - { - if (type.equals(createVarcharType(123))) { - return ImmutableSet.of(MIN_VALUE, MAX_VALUE); - } - - return ImmutableSet.of(); - } - @Override public PartitionStatistics getTableStatistics(Table table) {