use of io.trino.plugin.hive.metastore.thrift.ThriftMetastoreUtil.getHiveBasicStatistics in project trino by trinodb.
the class AlluxioHiveMetastore method getTableStatistics.
@Override
public PartitionStatistics getTableStatistics(Table table) {
try {
HiveBasicStatistics basicStats = ThriftMetastoreUtil.getHiveBasicStatistics(table.getParameters());
List<Column> columns = new ArrayList<>(table.getPartitionColumns());
columns.addAll(table.getDataColumns());
List<String> columnNames = columns.stream().map(Column::getName).collect(Collectors.toList());
List<ColumnStatisticsInfo> colStatsList = client.getTableColumnStatistics(table.getDatabaseName(), table.getTableName(), columnNames);
return new PartitionStatistics(basicStats, groupStatisticsByColumn(colStatsList, basicStats.getRowCount()));
} catch (Exception e) {
throw new TrinoException(HIVE_METASTORE_ERROR, e);
}
}
Aggregations