Search in sources :

Example 16 with HiveBasicStatistics

use of io.trino.plugin.hive.HiveBasicStatistics in project trino by trinodb.

the class FileHiveMetastore method getPartitionStatisticsInternal.

private synchronized PartitionStatistics getPartitionStatisticsInternal(Table table, List<String> partitionValues) {
    Path partitionDirectory = getPartitionMetadataDirectory(table, ImmutableList.copyOf(partitionValues));
    PartitionMetadata partitionMetadata = readSchemaFile(PARTITION, partitionDirectory, partitionCodec).orElseThrow(() -> new PartitionNotFoundException(table.getSchemaTableName(), partitionValues));
    HiveBasicStatistics basicStatistics = getHiveBasicStatistics(partitionMetadata.getParameters());
    return new PartitionStatistics(basicStatistics, partitionMetadata.getColumnStatistics());
}
Also used : Path(org.apache.hadoop.fs.Path) PartitionNotFoundException(io.trino.plugin.hive.PartitionNotFoundException) PartitionStatistics(io.trino.plugin.hive.PartitionStatistics) ThriftMetastoreUtil.getHiveBasicStatistics(io.trino.plugin.hive.metastore.thrift.ThriftMetastoreUtil.getHiveBasicStatistics) HiveBasicStatistics(io.trino.plugin.hive.HiveBasicStatistics)

Example 17 with HiveBasicStatistics

use of io.trino.plugin.hive.HiveBasicStatistics in project trino by trinodb.

the class DefaultGlueColumnStatisticsProvider method getTableColumnStatistics.

@Override
public Map<String, HiveColumnStatistics> getTableColumnStatistics(Table table) {
    try {
        List<String> columnNames = getAllColumns(table);
        List<List<String>> columnChunks = Lists.partition(columnNames, GLUE_COLUMN_READ_STAT_PAGE_SIZE);
        List<CompletableFuture<GetColumnStatisticsForTableResult>> getStatsFutures = columnChunks.stream().map(partialColumns -> supplyAsync(() -> {
            GetColumnStatisticsForTableRequest request = new GetColumnStatisticsForTableRequest().withCatalogId(catalogId).withDatabaseName(table.getDatabaseName()).withTableName(table.getTableName()).withColumnNames(partialColumns);
            return stats.getGetColumnStatisticsForTable().call(() -> glueClient.getColumnStatisticsForTable(request));
        }, readExecutor)).collect(toImmutableList());
        HiveBasicStatistics tableStatistics = getHiveBasicStatistics(table.getParameters());
        ImmutableMap.Builder<String, HiveColumnStatistics> columnStatsMapBuilder = ImmutableMap.builder();
        for (CompletableFuture<GetColumnStatisticsForTableResult> future : getStatsFutures) {
            GetColumnStatisticsForTableResult tableColumnsStats = getFutureValue(future, TrinoException.class);
            for (ColumnStatistics columnStatistics : tableColumnsStats.getColumnStatisticsList()) {
                columnStatsMapBuilder.put(columnStatistics.getColumnName(), fromGlueColumnStatistics(columnStatistics.getStatisticsData(), tableStatistics.getRowCount()));
            }
        }
        return columnStatsMapBuilder.buildOrThrow();
    } catch (RuntimeException ex) {
        throw new TrinoException(HIVE_METASTORE_ERROR, ex);
    }
}
Also used : ThriftMetastoreUtil.getHiveBasicStatistics(io.trino.plugin.hive.metastore.thrift.ThriftMetastoreUtil.getHiveBasicStatistics) GetColumnStatisticsForPartitionResult(com.amazonaws.services.glue.model.GetColumnStatisticsForPartitionResult) GetColumnStatisticsForPartitionRequest(com.amazonaws.services.glue.model.GetColumnStatisticsForPartitionRequest) ColumnStatisticType(io.trino.spi.statistics.ColumnStatisticType) Sets.difference(com.google.common.collect.Sets.difference) GetColumnStatisticsForTableResult(com.amazonaws.services.glue.model.GetColumnStatisticsForTableResult) Column(io.trino.plugin.hive.metastore.Column) Map(java.util.Map) DoubleColumnStatisticsData(com.amazonaws.services.glue.model.DoubleColumnStatisticsData) HiveBasicStatistics(io.trino.plugin.hive.HiveBasicStatistics) Table(io.trino.plugin.hive.metastore.Table) HIVE_PARTITION_NOT_FOUND(io.trino.plugin.hive.HiveErrorCode.HIVE_PARTITION_NOT_FOUND) GlueStatConverter.fromGlueColumnStatistics(io.trino.plugin.hive.metastore.glue.converter.GlueStatConverter.fromGlueColumnStatistics) ColumnStatistics(com.amazonaws.services.glue.model.ColumnStatistics) ImmutableMap(com.google.common.collect.ImmutableMap) Collection(java.util.Collection) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Set(java.util.Set) TrinoException(io.trino.spi.TrinoException) List(java.util.List) DeleteColumnStatisticsForTableRequest(com.amazonaws.services.glue.model.DeleteColumnStatisticsForTableRequest) Optional(java.util.Optional) GetColumnStatisticsForTableRequest(com.amazonaws.services.glue.model.GetColumnStatisticsForTableRequest) UpdateColumnStatisticsForPartitionRequest(com.amazonaws.services.glue.model.UpdateColumnStatisticsForPartitionRequest) EntityNotFoundException(com.amazonaws.services.glue.model.EntityNotFoundException) AWSGlueAsync(com.amazonaws.services.glue.AWSGlueAsync) Partition(io.trino.plugin.hive.metastore.Partition) Type(io.trino.spi.type.Type) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) ArrayList(java.util.ArrayList) Collectors.toUnmodifiableList(java.util.stream.Collectors.toUnmodifiableList) HiveColumnStatistics(io.trino.plugin.hive.metastore.HiveColumnStatistics) ThriftMetastoreUtil(io.trino.plugin.hive.metastore.thrift.ThriftMetastoreUtil) ColumnStatisticsData(com.amazonaws.services.glue.model.ColumnStatisticsData) Lists(com.google.common.collect.Lists) ImmutableList(com.google.common.collect.ImmutableList) CompletableFuture.allOf(java.util.concurrent.CompletableFuture.allOf) HIVE_METASTORE_ERROR(io.trino.plugin.hive.HiveErrorCode.HIVE_METASTORE_ERROR) CompletableFuture.supplyAsync(java.util.concurrent.CompletableFuture.supplyAsync) CompletableFuture.runAsync(java.util.concurrent.CompletableFuture.runAsync) DecimalColumnStatisticsData(com.amazonaws.services.glue.model.DecimalColumnStatisticsData) Executor(java.util.concurrent.Executor) ColumnStatisticsType(com.amazonaws.services.glue.model.ColumnStatisticsType) MoreFutures.getFutureValue(io.airlift.concurrent.MoreFutures.getFutureValue) DateColumnStatisticsData(com.amazonaws.services.glue.model.DateColumnStatisticsData) LongColumnStatisticsData(com.amazonaws.services.glue.model.LongColumnStatisticsData) GlueStatConverter.toGlueColumnStatistics(io.trino.plugin.hive.metastore.glue.converter.GlueStatConverter.toGlueColumnStatistics) DeleteColumnStatisticsForPartitionRequest(com.amazonaws.services.glue.model.DeleteColumnStatisticsForPartitionRequest) UpdateColumnStatisticsForTableRequest(com.amazonaws.services.glue.model.UpdateColumnStatisticsForTableRequest) GlueStatConverter.fromGlueColumnStatistics(io.trino.plugin.hive.metastore.glue.converter.GlueStatConverter.fromGlueColumnStatistics) ColumnStatistics(com.amazonaws.services.glue.model.ColumnStatistics) HiveColumnStatistics(io.trino.plugin.hive.metastore.HiveColumnStatistics) GlueStatConverter.toGlueColumnStatistics(io.trino.plugin.hive.metastore.glue.converter.GlueStatConverter.toGlueColumnStatistics) GetColumnStatisticsForTableRequest(com.amazonaws.services.glue.model.GetColumnStatisticsForTableRequest) HiveColumnStatistics(io.trino.plugin.hive.metastore.HiveColumnStatistics) ThriftMetastoreUtil.getHiveBasicStatistics(io.trino.plugin.hive.metastore.thrift.ThriftMetastoreUtil.getHiveBasicStatistics) HiveBasicStatistics(io.trino.plugin.hive.HiveBasicStatistics) GetColumnStatisticsForTableResult(com.amazonaws.services.glue.model.GetColumnStatisticsForTableResult) ImmutableMap(com.google.common.collect.ImmutableMap) CompletableFuture(java.util.concurrent.CompletableFuture) TrinoException(io.trino.spi.TrinoException) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) List(java.util.List) ArrayList(java.util.ArrayList) Collectors.toUnmodifiableList(java.util.stream.Collectors.toUnmodifiableList) ImmutableList(com.google.common.collect.ImmutableList)

Example 18 with HiveBasicStatistics

use of io.trino.plugin.hive.HiveBasicStatistics in project trino by trinodb.

the class DefaultGlueColumnStatisticsProvider method updatePartitionStatistics.

@Override
public void updatePartitionStatistics(Set<PartitionStatisticsUpdate> partitionStatisticsUpdates) {
    Map<Partition, Map<String, HiveColumnStatistics>> currentStatistics = getPartitionColumnStatistics(partitionStatisticsUpdates.stream().map(PartitionStatisticsUpdate::getPartition).collect(toImmutableList()));
    List<CompletableFuture<Void>> updateFutures = new ArrayList<>();
    for (PartitionStatisticsUpdate update : partitionStatisticsUpdates) {
        Partition partition = update.getPartition();
        Map<String, HiveColumnStatistics> updatedColumnStatistics = update.getColumnStatistics();
        HiveBasicStatistics partitionStats = getHiveBasicStatistics(partition.getParameters());
        List<ColumnStatistics> columnStats = toGlueColumnStatistics(partition, updatedColumnStatistics, partitionStats.getRowCount()).stream().filter(this::isGlueWritable).collect(toUnmodifiableList());
        List<List<ColumnStatistics>> columnChunks = Lists.partition(columnStats, GLUE_COLUMN_WRITE_STAT_PAGE_SIZE);
        columnChunks.forEach(columnChunk -> updateFutures.add(runAsync(() -> stats.getUpdateColumnStatisticsForPartition().call(() -> glueClient.updateColumnStatisticsForPartition(new UpdateColumnStatisticsForPartitionRequest().withCatalogId(catalogId).withDatabaseName(partition.getDatabaseName()).withTableName(partition.getTableName()).withPartitionValues(partition.getValues()).withColumnStatisticsList(columnChunk))), writeExecutor)));
        Set<String> removedStatistics = difference(currentStatistics.get(partition).keySet(), updatedColumnStatistics.keySet());
        removedStatistics.forEach(column -> updateFutures.add(runAsync(() -> stats.getDeleteColumnStatisticsForPartition().call(() -> glueClient.deleteColumnStatisticsForPartition(new DeleteColumnStatisticsForPartitionRequest().withCatalogId(catalogId).withDatabaseName(partition.getDatabaseName()).withTableName(partition.getTableName()).withPartitionValues(partition.getValues()).withColumnName(column))), writeExecutor)));
    }
    try {
        getFutureValue(allOf(updateFutures.toArray(CompletableFuture[]::new)));
    } catch (RuntimeException ex) {
        if (ex.getCause() != null && ex.getCause() instanceof EntityNotFoundException) {
            throw new TrinoException(HIVE_PARTITION_NOT_FOUND, ex.getCause());
        }
        throw new TrinoException(HIVE_METASTORE_ERROR, ex);
    }
}
Also used : GlueStatConverter.fromGlueColumnStatistics(io.trino.plugin.hive.metastore.glue.converter.GlueStatConverter.fromGlueColumnStatistics) ColumnStatistics(com.amazonaws.services.glue.model.ColumnStatistics) HiveColumnStatistics(io.trino.plugin.hive.metastore.HiveColumnStatistics) GlueStatConverter.toGlueColumnStatistics(io.trino.plugin.hive.metastore.glue.converter.GlueStatConverter.toGlueColumnStatistics) Partition(io.trino.plugin.hive.metastore.Partition) ArrayList(java.util.ArrayList) HiveColumnStatistics(io.trino.plugin.hive.metastore.HiveColumnStatistics) DeleteColumnStatisticsForPartitionRequest(com.amazonaws.services.glue.model.DeleteColumnStatisticsForPartitionRequest) EntityNotFoundException(com.amazonaws.services.glue.model.EntityNotFoundException) ThriftMetastoreUtil.getHiveBasicStatistics(io.trino.plugin.hive.metastore.thrift.ThriftMetastoreUtil.getHiveBasicStatistics) HiveBasicStatistics(io.trino.plugin.hive.HiveBasicStatistics) CompletableFuture(java.util.concurrent.CompletableFuture) UpdateColumnStatisticsForPartitionRequest(com.amazonaws.services.glue.model.UpdateColumnStatisticsForPartitionRequest) TrinoException(io.trino.spi.TrinoException) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) List(java.util.List) ArrayList(java.util.ArrayList) Collectors.toUnmodifiableList(java.util.stream.Collectors.toUnmodifiableList) ImmutableList(com.google.common.collect.ImmutableList) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) HashMap(java.util.HashMap)

Example 19 with HiveBasicStatistics

use of io.trino.plugin.hive.HiveBasicStatistics in project trino by trinodb.

the class DefaultGlueColumnStatisticsProvider method getPartitionColumnStatistics.

@Override
public Map<Partition, Map<String, HiveColumnStatistics>> getPartitionColumnStatistics(Collection<Partition> partitions) {
    Map<Partition, List<CompletableFuture<GetColumnStatisticsForPartitionResult>>> resultsForPartition = new HashMap<>();
    for (Partition partition : partitions) {
        ImmutableList.Builder<CompletableFuture<GetColumnStatisticsForPartitionResult>> futures = ImmutableList.builder();
        List<List<Column>> columnChunks = Lists.partition(partition.getColumns(), GLUE_COLUMN_READ_STAT_PAGE_SIZE);
        for (List<Column> partialPartitionColumns : columnChunks) {
            List<String> columnsNames = partialPartitionColumns.stream().map(Column::getName).collect(toImmutableList());
            GetColumnStatisticsForPartitionRequest request = new GetColumnStatisticsForPartitionRequest().withCatalogId(catalogId).withDatabaseName(partition.getDatabaseName()).withTableName(partition.getTableName()).withColumnNames(columnsNames).withPartitionValues(partition.getValues());
            futures.add(supplyAsync(() -> stats.getGetColumnStatisticsForPartition().call(() -> glueClient.getColumnStatisticsForPartition(request)), readExecutor));
        }
        resultsForPartition.put(partition, futures.build());
    }
    try {
        ImmutableMap.Builder<Partition, Map<String, HiveColumnStatistics>> partitionStatistics = ImmutableMap.builder();
        resultsForPartition.forEach((partition, futures) -> {
            HiveBasicStatistics tableStatistics = getHiveBasicStatistics(partition.getParameters());
            ImmutableMap.Builder<String, HiveColumnStatistics> columnStatsMapBuilder = ImmutableMap.builder();
            for (CompletableFuture<GetColumnStatisticsForPartitionResult> getColumnStatisticsResultFuture : futures) {
                GetColumnStatisticsForPartitionResult getColumnStatisticsResult = getFutureValue(getColumnStatisticsResultFuture);
                getColumnStatisticsResult.getColumnStatisticsList().forEach(columnStatistics -> columnStatsMapBuilder.put(columnStatistics.getColumnName(), fromGlueColumnStatistics(columnStatistics.getStatisticsData(), tableStatistics.getRowCount())));
            }
            partitionStatistics.put(partition, columnStatsMapBuilder.buildOrThrow());
        });
        return partitionStatistics.buildOrThrow();
    } catch (RuntimeException ex) {
        if (ex.getCause() != null && ex.getCause() instanceof EntityNotFoundException) {
            throw new TrinoException(HIVE_PARTITION_NOT_FOUND, ex.getCause());
        }
        throw new TrinoException(HIVE_METASTORE_ERROR, ex);
    }
}
Also used : Partition(io.trino.plugin.hive.metastore.Partition) HashMap(java.util.HashMap) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) ImmutableList(com.google.common.collect.ImmutableList) HiveColumnStatistics(io.trino.plugin.hive.metastore.HiveColumnStatistics) EntityNotFoundException(com.amazonaws.services.glue.model.EntityNotFoundException) ThriftMetastoreUtil.getHiveBasicStatistics(io.trino.plugin.hive.metastore.thrift.ThriftMetastoreUtil.getHiveBasicStatistics) HiveBasicStatistics(io.trino.plugin.hive.HiveBasicStatistics) ImmutableMap(com.google.common.collect.ImmutableMap) GetColumnStatisticsForPartitionRequest(com.amazonaws.services.glue.model.GetColumnStatisticsForPartitionRequest) CompletableFuture(java.util.concurrent.CompletableFuture) GetColumnStatisticsForPartitionResult(com.amazonaws.services.glue.model.GetColumnStatisticsForPartitionResult) Column(io.trino.plugin.hive.metastore.Column) TrinoException(io.trino.spi.TrinoException) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) List(java.util.List) ArrayList(java.util.ArrayList) Collectors.toUnmodifiableList(java.util.stream.Collectors.toUnmodifiableList) ImmutableList(com.google.common.collect.ImmutableList) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) HashMap(java.util.HashMap)

Example 20 with HiveBasicStatistics

use of io.trino.plugin.hive.HiveBasicStatistics in project trino by trinodb.

the class DefaultGlueColumnStatisticsProvider method updateTableColumnStatistics.

@Override
public void updateTableColumnStatistics(Table table, Map<String, HiveColumnStatistics> updatedTableColumnStatistics) {
    try {
        HiveBasicStatistics tableStats = getHiveBasicStatistics(table.getParameters());
        List<ColumnStatistics> columnStats = toGlueColumnStatistics(table, updatedTableColumnStatistics, tableStats.getRowCount()).stream().filter(this::isGlueWritable).collect(toUnmodifiableList());
        List<List<ColumnStatistics>> columnChunks = Lists.partition(columnStats, GLUE_COLUMN_WRITE_STAT_PAGE_SIZE);
        List<CompletableFuture<Void>> updateFutures = columnChunks.stream().map(columnChunk -> runAsync(() -> stats.getUpdateColumnStatisticsForTable().call(() -> glueClient.updateColumnStatisticsForTable(new UpdateColumnStatisticsForTableRequest().withCatalogId(catalogId).withDatabaseName(table.getDatabaseName()).withTableName(table.getTableName()).withColumnStatisticsList(columnChunk))), this.writeExecutor)).collect(toUnmodifiableList());
        Map<String, HiveColumnStatistics> currentTableColumnStatistics = this.getTableColumnStatistics(table);
        Set<String> removedStatistics = difference(currentTableColumnStatistics.keySet(), updatedTableColumnStatistics.keySet());
        List<CompletableFuture<Void>> deleteFutures = removedStatistics.stream().map(column -> runAsync(() -> stats.getDeleteColumnStatisticsForTable().call(() -> glueClient.deleteColumnStatisticsForTable(new DeleteColumnStatisticsForTableRequest().withCatalogId(catalogId).withDatabaseName(table.getDatabaseName()).withTableName(table.getTableName()).withColumnName(column))), this.writeExecutor)).collect(toUnmodifiableList());
        ImmutableList<CompletableFuture<Void>> updateOperationsFutures = ImmutableList.<CompletableFuture<Void>>builder().addAll(updateFutures).addAll(deleteFutures).build();
        getFutureValue(allOf(updateOperationsFutures.toArray(CompletableFuture[]::new)));
    } catch (RuntimeException ex) {
        throw new TrinoException(HIVE_METASTORE_ERROR, ex);
    }
}
Also used : GlueStatConverter.fromGlueColumnStatistics(io.trino.plugin.hive.metastore.glue.converter.GlueStatConverter.fromGlueColumnStatistics) ColumnStatistics(com.amazonaws.services.glue.model.ColumnStatistics) HiveColumnStatistics(io.trino.plugin.hive.metastore.HiveColumnStatistics) GlueStatConverter.toGlueColumnStatistics(io.trino.plugin.hive.metastore.glue.converter.GlueStatConverter.toGlueColumnStatistics) ThriftMetastoreUtil.getHiveBasicStatistics(io.trino.plugin.hive.metastore.thrift.ThriftMetastoreUtil.getHiveBasicStatistics) GetColumnStatisticsForPartitionResult(com.amazonaws.services.glue.model.GetColumnStatisticsForPartitionResult) GetColumnStatisticsForPartitionRequest(com.amazonaws.services.glue.model.GetColumnStatisticsForPartitionRequest) ColumnStatisticType(io.trino.spi.statistics.ColumnStatisticType) Sets.difference(com.google.common.collect.Sets.difference) GetColumnStatisticsForTableResult(com.amazonaws.services.glue.model.GetColumnStatisticsForTableResult) Column(io.trino.plugin.hive.metastore.Column) Map(java.util.Map) DoubleColumnStatisticsData(com.amazonaws.services.glue.model.DoubleColumnStatisticsData) HiveBasicStatistics(io.trino.plugin.hive.HiveBasicStatistics) Table(io.trino.plugin.hive.metastore.Table) HIVE_PARTITION_NOT_FOUND(io.trino.plugin.hive.HiveErrorCode.HIVE_PARTITION_NOT_FOUND) GlueStatConverter.fromGlueColumnStatistics(io.trino.plugin.hive.metastore.glue.converter.GlueStatConverter.fromGlueColumnStatistics) ColumnStatistics(com.amazonaws.services.glue.model.ColumnStatistics) ImmutableMap(com.google.common.collect.ImmutableMap) Collection(java.util.Collection) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Set(java.util.Set) TrinoException(io.trino.spi.TrinoException) List(java.util.List) DeleteColumnStatisticsForTableRequest(com.amazonaws.services.glue.model.DeleteColumnStatisticsForTableRequest) Optional(java.util.Optional) GetColumnStatisticsForTableRequest(com.amazonaws.services.glue.model.GetColumnStatisticsForTableRequest) UpdateColumnStatisticsForPartitionRequest(com.amazonaws.services.glue.model.UpdateColumnStatisticsForPartitionRequest) EntityNotFoundException(com.amazonaws.services.glue.model.EntityNotFoundException) AWSGlueAsync(com.amazonaws.services.glue.AWSGlueAsync) Partition(io.trino.plugin.hive.metastore.Partition) Type(io.trino.spi.type.Type) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) ArrayList(java.util.ArrayList) Collectors.toUnmodifiableList(java.util.stream.Collectors.toUnmodifiableList) HiveColumnStatistics(io.trino.plugin.hive.metastore.HiveColumnStatistics) ThriftMetastoreUtil(io.trino.plugin.hive.metastore.thrift.ThriftMetastoreUtil) ColumnStatisticsData(com.amazonaws.services.glue.model.ColumnStatisticsData) Lists(com.google.common.collect.Lists) ImmutableList(com.google.common.collect.ImmutableList) CompletableFuture.allOf(java.util.concurrent.CompletableFuture.allOf) HIVE_METASTORE_ERROR(io.trino.plugin.hive.HiveErrorCode.HIVE_METASTORE_ERROR) CompletableFuture.supplyAsync(java.util.concurrent.CompletableFuture.supplyAsync) CompletableFuture.runAsync(java.util.concurrent.CompletableFuture.runAsync) DecimalColumnStatisticsData(com.amazonaws.services.glue.model.DecimalColumnStatisticsData) Executor(java.util.concurrent.Executor) ColumnStatisticsType(com.amazonaws.services.glue.model.ColumnStatisticsType) MoreFutures.getFutureValue(io.airlift.concurrent.MoreFutures.getFutureValue) DateColumnStatisticsData(com.amazonaws.services.glue.model.DateColumnStatisticsData) LongColumnStatisticsData(com.amazonaws.services.glue.model.LongColumnStatisticsData) GlueStatConverter.toGlueColumnStatistics(io.trino.plugin.hive.metastore.glue.converter.GlueStatConverter.toGlueColumnStatistics) DeleteColumnStatisticsForPartitionRequest(com.amazonaws.services.glue.model.DeleteColumnStatisticsForPartitionRequest) UpdateColumnStatisticsForTableRequest(com.amazonaws.services.glue.model.UpdateColumnStatisticsForTableRequest) UpdateColumnStatisticsForTableRequest(com.amazonaws.services.glue.model.UpdateColumnStatisticsForTableRequest) HiveColumnStatistics(io.trino.plugin.hive.metastore.HiveColumnStatistics) ThriftMetastoreUtil.getHiveBasicStatistics(io.trino.plugin.hive.metastore.thrift.ThriftMetastoreUtil.getHiveBasicStatistics) HiveBasicStatistics(io.trino.plugin.hive.HiveBasicStatistics) CompletableFuture(java.util.concurrent.CompletableFuture) TrinoException(io.trino.spi.TrinoException) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) List(java.util.List) ArrayList(java.util.ArrayList) Collectors.toUnmodifiableList(java.util.stream.Collectors.toUnmodifiableList) ImmutableList(com.google.common.collect.ImmutableList) DeleteColumnStatisticsForTableRequest(com.amazonaws.services.glue.model.DeleteColumnStatisticsForTableRequest)

Aggregations

HiveBasicStatistics (io.trino.plugin.hive.HiveBasicStatistics)22 PartitionStatistics (io.trino.plugin.hive.PartitionStatistics)13 ThriftMetastoreUtil.getHiveBasicStatistics (io.trino.plugin.hive.metastore.thrift.ThriftMetastoreUtil.getHiveBasicStatistics)13 HiveColumnStatistics (io.trino.plugin.hive.metastore.HiveColumnStatistics)11 TrinoException (io.trino.spi.TrinoException)11 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)9 ImmutableMap (com.google.common.collect.ImmutableMap)9 Column (io.trino.plugin.hive.metastore.Column)8 List (java.util.List)8 Map (java.util.Map)8 ImmutableList (com.google.common.collect.ImmutableList)7 OptionalLong (java.util.OptionalLong)7 HIVE_METASTORE_ERROR (io.trino.plugin.hive.HiveErrorCode.HIVE_METASTORE_ERROR)6 ColumnStatisticType (io.trino.spi.statistics.ColumnStatisticType)6 Type (io.trino.spi.type.Type)6 ArrayList (java.util.ArrayList)6 Optional (java.util.Optional)6 Set (java.util.Set)6 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)5 Sets.difference (com.google.common.collect.Sets.difference)5