Package org.apache.druid.segment.filter
Class SpatialFilter
- java.lang.Object
-
- org.apache.druid.segment.filter.SpatialFilter
-
-
Constructor Summary
Constructors Constructor Description SpatialFilter(String dimension, Bound bound, FilterTuning filterTuning)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
double
estimateSelectivity(ColumnIndexSelector indexSelector)
Estimate selectivity of this filter.BitmapColumnIndex
getBitmapColumnIndex(ColumnIndexSelector selector)
Returns aBitmapColumnIndex
if this filter supports using a bitmap index for filtering for the given inputColumnIndexSelector
.Set<String>
getRequiredColumns()
Set of columns used by a filter.int
hashCode()
ValueMatcher
makeMatcher(ColumnSelectorFactory factory)
Get aValueMatcher
that applies this filter to row values.boolean
supportsSelectivityEstimation(ColumnSelector columnSelector, ColumnIndexSelector indexSelector)
Indicates whether this filter supports selectivity estimation.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.query.filter.Filter
canVectorizeMatcher, makeVectorMatcher, rewriteRequiredColumns, supportsRequiredColumnRewrite
-
-
-
-
Constructor Detail
-
SpatialFilter
public SpatialFilter(String dimension, Bound bound, FilterTuning filterTuning)
-
-
Method Detail
-
getBitmapColumnIndex
@Nullable public BitmapColumnIndex getBitmapColumnIndex(ColumnIndexSelector selector)
Description copied from interface:Filter
Returns aBitmapColumnIndex
if this filter supports using a bitmap index for filtering for the given inputColumnIndexSelector
. TheBitmapColumnIndex
can be used to compute into a bitmap indicating rows that match this filter resultBitmapColumnIndex.computeBitmapResult(BitmapResultFactory, boolean)
, or examine details about the index prior to computing it, viaBitmapColumnIndex.getIndexCapabilities()
.- Specified by:
getBitmapColumnIndex
in interfaceFilter
- Parameters:
selector
- Object used to create BitmapColumnIndex- Returns:
- BitmapColumnIndex that can build ImmutableBitmap of matched row numbers
-
makeMatcher
public ValueMatcher makeMatcher(ColumnSelectorFactory factory)
Description copied from interface:Filter
Get aValueMatcher
that applies this filter to row values.- Specified by:
makeMatcher
in interfaceFilter
- Parameters:
factory
- Object used to create ValueMatchers- Returns:
- ValueMatcher that applies this filter to row values.
-
supportsSelectivityEstimation
public boolean supportsSelectivityEstimation(ColumnSelector columnSelector, ColumnIndexSelector indexSelector)
Description copied from interface:Filter
Indicates whether this filter supports selectivity estimation. A filter supports selectivity estimation if it supports bitmap index and the dimension which the filter evaluates does not have multi values.- Specified by:
supportsSelectivityEstimation
in interfaceFilter
- Parameters:
columnSelector
- Object to check the dimension has multi values.indexSelector
- Object used to retrieve bitmap indexes- Returns:
- true if this Filter supports selectivity estimation, false otherwise.
-
getRequiredColumns
public Set<String> getRequiredColumns()
Description copied from interface:Filter
Set of columns used by a filter.- Specified by:
getRequiredColumns
in interfaceFilter
-
estimateSelectivity
public double estimateSelectivity(ColumnIndexSelector indexSelector)
Description copied from interface:Filter
Estimate selectivity of this filter. This method can be used for cost-based query planning like inAutoStrategy
. To avoid significant performance degradation for calculating the exact cost, implementation of this method targets to achieve rapid selectivity estimation with reasonable sacrifice of the accuracy. As a result, the estimated selectivity might be different from the exact value.- Specified by:
estimateSelectivity
in interfaceFilter
- Parameters:
indexSelector
- Object used to retrieve indexes- Returns:
- an estimated selectivity ranging from 0 (filter selects no rows) to 1 (filter selects all rows).
- See Also:
Filter.getBitmapColumnIndex(ColumnIndexSelector)
-
-