use of com.facebook.presto.tpcds.TpcdsColumnHandle in project presto by prestodb.
the class TpcdsTableStatisticsFactory method toTableStatistics.
private TableStatistics toTableStatistics(List<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 (ColumnHandle handle : columnHandles) {
TpcdsColumnHandle columnHandle = (TpcdsColumnHandle) handle;
tableStatistics.setColumnStatistics(columnHandle, toColumnStatistics(columnsData.get(columnHandle.getColumnName()), columnHandle.getType(), rowCount));
}
}
return tableStatistics.build();
}
Aggregations