public Statistics createUnpartitionedStats(
            HivePartitionStats tableStats,
            List<ColumnRefOperator> columns,
            Statistics.Builder builder,
            Table table) {
        long rowNum = tableStats.getCommonStats().getRowNums();
        if (rowNum == -1) {
            builder.setOutputRowCount(getEstimatedRowCount(table, Lists.newArrayList(new PartitionKey())));
            return builder.build();
        } else {
            builder.setOutputRowCount(rowNum);
        }

        for (ColumnRefOperator columnRefOperator : columns) {
            Column column = table.getColumn(columnRefOperator.getName());
            builder.addColumnStatistic(columnRefOperator,
                    createDataColumnStatistics(column, rowNum, Collections.singleton(tableStats)));
        }

        return builder.build();
    }
@Test
    public void testCreateUnpartitionedStats() {
        HiveTable hiveTable = (HiveTable) hmsOps.getTable("db1", "table1");
        ColumnRefOperator dataColumnRefOperator = new ColumnRefOperator(1, Type.INT, "col2", true);
        cachingHiveMetastore.getPartitionStatistics(hiveTable, Lists.newArrayList("col1=1"));
        Map<String, HivePartitionStats> statisticsMap = hmsOps.getPartitionStatistics(
                hiveTable, Lists.newArrayList("col1=1"));
        HivePartitionStats dataStats = statisticsMap.get("col1=1");
        Statistics.Builder builder = Statistics.builder();
        Statistics statistics = statisticsProvider.createUnpartitionedStats(
                dataStats, Lists.newArrayList(dataColumnRefOperator), builder, hiveTable);
        Map<ColumnRefOperator, ColumnStatistic> columnStatistics = statistics.getColumnStatistics();
        ColumnStatistic dataColumnStats = columnStatistics.get(dataColumnRefOperator);
        Assert.assertEquals(0, dataColumnStats.getMinValue(), 0.001);
        Assert.assertEquals(0.02, dataColumnStats.getNullsFraction(), 0.001);
        Assert.assertEquals(4, dataColumnStats.getAverageRowSize(), 0.001);
        Assert.assertEquals(2, dataColumnStats.getDistinctValuesCount(), 0.001);
    }