use of io.trino.plugin.tpcds.TpcdsColumnHandle in project trino by trinodb.
the class TpcdsTableStatisticsFactory method toTableStatistics.
private TableStatistics toTableStatistics(Map<String, ColumnHandle> columnHandles, TableStatisticsData statisticsData) {
long rowCount = statisticsData.getRowCount();
TableStatistics.Builder tableStatistics = TableStatistics.builder().setRowCount(Estimate.of(rowCount));
if (rowCount > 0) {
Map<String, ColumnStatisticsData> columnsData = statisticsData.getColumns();
for (Map.Entry<String, ColumnHandle> entry : columnHandles.entrySet()) {
TpcdsColumnHandle columnHandle = (TpcdsColumnHandle) entry.getValue();
tableStatistics.setColumnStatistics(entry.getValue(), toColumnStatistics(columnsData.get(entry.getKey()), columnHandle.getType(), rowCount));
}
}
return tableStatistics.build();
}
Aggregations