public class DrillStatsTable extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DrillStatsTable.ColumnStatistics |
static class |
DrillStatsTable.ColumnStatistics_v1 |
static class |
DrillStatsTable.DirectoryStatistics |
static class |
DrillStatsTable.DirectoryStatistics_v0 |
static class |
DrillStatsTable.DirectoryStatistics_v1 |
static class |
DrillStatsTable.Statistics_v0 |
static class |
DrillStatsTable.Statistics_v1
Struct which contains the statistics for the entire directory structure
|
static class |
DrillStatsTable.STATS_VERSION |
static class |
DrillStatsTable.TableStatistics |
Modifier and Type | Field and Description |
---|---|
static DrillStatsTable.STATS_VERSION |
CURRENT_VERSION |
static int |
NUM_HISTOGRAM_BUCKETS |
Constructor and Description |
---|
DrillStatsTable(DrillStatsTable.TableStatistics statistics) |
DrillStatsTable(DrillTable table,
String schemaName,
String tableName,
org.apache.hadoop.fs.Path tablePath,
org.apache.hadoop.fs.FileSystem fs) |
Modifier and Type | Method and Description |
---|---|
static PhysicalPlan |
direct(QueryContext context,
boolean outcome,
String message,
Object... values) |
static DrillStatsTable.TableStatistics |
generateDirectoryStructure(String dirComputedTime,
List<DrillStatsTable.ColumnStatistics> columnStatisticsList) |
Set<SchemaPath> |
getColumns() |
static List<StatisticsHolder<?>> |
getEstimatedColumnStats(DrillStatsTable statsProvider,
SchemaPath fieldName)
Returns list of
StatisticsKind and statistics values obtained from specified DrillStatsTable for specified column. |
static List<StatisticsHolder<?>> |
getEstimatedTableStats(DrillStatsTable statsProvider)
Returns list of
StatisticsKind and statistics values obtained from specified DrillStatsTable . |
Histogram |
getHistogram(SchemaPath column)
Get the histogram of a given column.
|
static com.fasterxml.jackson.databind.ObjectMapper |
getMapper()
This method returns the statistics (de)serializer which can be used to (de)/serialize the
DrillStatsTable.TableStatistics from/to JSON |
Double |
getNdv(SchemaPath col)
Get the approximate number of distinct values of given column.
|
Double |
getNNRowCount(SchemaPath col)
Get non-null rowcount for the column If stats are not present for the given column, a null is returned.
|
Double |
getRowCount()
Get row count of the table.
|
String |
getSchemaName() |
String |
getTableName() |
boolean |
isMaterialized() |
void |
materialize()
Read the stats from storage and keep them in memory.
|
static PhysicalPlan |
notRequired(QueryContext context,
String tbl) |
static PhysicalPlan |
notSupported(QueryContext context,
String tbl) |
public static final DrillStatsTable.STATS_VERSION CURRENT_VERSION
public static final int NUM_HISTOGRAM_BUCKETS
public DrillStatsTable(DrillTable table, String schemaName, String tableName, org.apache.hadoop.fs.Path tablePath, org.apache.hadoop.fs.FileSystem fs)
public DrillStatsTable(DrillStatsTable.TableStatistics statistics)
public String getSchemaName()
public String getTableName()
public boolean isMaterialized()
public Double getNdv(SchemaPath col)
col
- - column for which approximate count distinct is desiredpublic Set<SchemaPath> getColumns()
public Double getRowCount()
public Double getNNRowCount(SchemaPath col)
col
- - column for which non-null rowcount is desiredpublic Histogram getHistogram(SchemaPath column)
Note: returned data may not be accurate. Accuracy depends on whether the table data has changed after the stats are computed.
column
- path to the column whose histogram should be obtainedpublic void materialize()
public static DrillStatsTable.TableStatistics generateDirectoryStructure(String dirComputedTime, List<DrillStatsTable.ColumnStatistics> columnStatisticsList)
public static PhysicalPlan direct(QueryContext context, boolean outcome, String message, Object... values)
public static PhysicalPlan notSupported(QueryContext context, String tbl)
public static PhysicalPlan notRequired(QueryContext context, String tbl)
public static com.fasterxml.jackson.databind.ObjectMapper getMapper()
DrillStatsTable.TableStatistics
from/to JSONpublic static List<StatisticsHolder<?>> getEstimatedTableStats(DrillStatsTable statsProvider)
StatisticsKind
and statistics values obtained from specified DrillStatsTable
.statsProvider
- the source of statisticsStatisticsKind
and statistics valuespublic static List<StatisticsHolder<?>> getEstimatedColumnStats(DrillStatsTable statsProvider, SchemaPath fieldName)
StatisticsKind
and statistics values obtained from specified DrillStatsTable
for specified column.statsProvider
- the source of statisticsfieldName
- name of the columns whose statistics should be obtainedStatisticsKind
and statistics valuesCopyright © 1970 The Apache Software Foundation. All rights reserved.