Search in sources :

Example 1 with TpcdsColumnHandle

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();
}
Also used : ColumnHandle(com.facebook.presto.spi.ColumnHandle) TpcdsColumnHandle(com.facebook.presto.tpcds.TpcdsColumnHandle) TpcdsColumnHandle(com.facebook.presto.tpcds.TpcdsColumnHandle) TableStatistics(com.facebook.presto.spi.statistics.TableStatistics)

Aggregations

ColumnHandle (com.facebook.presto.spi.ColumnHandle)1 TableStatistics (com.facebook.presto.spi.statistics.TableStatistics)1 TpcdsColumnHandle (com.facebook.presto.tpcds.TpcdsColumnHandle)1