Constructor and Description |
---|
NumericEquiDepthHistogram() |
NumericEquiDepthHistogram(int numBuckets) |
Modifier and Type | Method and Description |
---|---|
static NumericEquiDepthHistogram |
buildFromTDigest(byte[] tdigest_array,
int numBuckets,
long nonNullCount)
Build a Numeric Equi-Depth Histogram from a t-digest byte array
|
Double |
estimatedSelectivity(org.apache.calcite.rex.RexNode columnFilter,
long totalRowCount,
long ndv)
Estimate the selectivity of a filter which may contain several range predicates and in the general case is of
type: col op value1 AND col op value2 AND col op value3 ...
|
Double[] |
getBuckets() |
int |
getNumBuckets()
Get the number of buckets in the histogram
number of buckets is 1 less than the total # entries in the buckets array since last
entry is the end point of the last bucket
|
double |
getNumRowsPerBucket() |
protected long |
getSelectedRows(org.apache.drill.shaded.guava.com.google.common.collect.Range range,
long ndv) |
protected void |
setBucketValue(int index,
Double value) |
void |
setNumRowsPerBucket(double numRows) |
public NumericEquiDepthHistogram()
public NumericEquiDepthHistogram(int numBuckets)
public double getNumRowsPerBucket()
public void setNumRowsPerBucket(double numRows)
public Double[] getBuckets()
protected void setBucketValue(int index, Double value)
public int getNumBuckets()
public Double estimatedSelectivity(org.apache.calcite.rex.RexNode columnFilter, long totalRowCount, long ndv)
e.g a > 10 AND a < 50 AND a >= 20 AND a <= 70 ...
Even though in most cases it will have either 1 or 2 range conditions, we still have to handle the general case For each conjunct, we will find the histogram bucket ranges and intersect them, taking into account that the first and last bucket may be partially covered and all other buckets in the middle are fully covered.estimatedSelectivity
in interface Histogram
protected long getSelectedRows(org.apache.drill.shaded.guava.com.google.common.collect.Range range, long ndv)
public static NumericEquiDepthHistogram buildFromTDigest(byte[] tdigest_array, int numBuckets, long nonNullCount)
tdigest_array
- numBuckets
- nonNullCount
- Copyright © 1970 The Apache Software Foundation. All rights reserved.