public class InDimFilter extends AbstractOptimizableDimFilter implements Filter
| Modifier and Type | Class and Description |
|---|---|
static class |
InDimFilter.InFilterDruidPredicateFactory |
static class |
InDimFilter.ValuesSet |
DimFilter.DimFilterToStringBuilder| Constructor and Description |
|---|
InDimFilter(String dimension,
Collection<String> values,
ExtractionFn extractionFn)
Creates a new filter without an extraction function or any special filter tuning.
|
InDimFilter(String dimension,
InDimFilter.ValuesSet values,
ExtractionFn extractionFn,
FilterTuning filterTuning)
Creates a new filter.
|
InDimFilter(String dimension,
Set<String> values)
Creates a new filter without an extraction function or any special filter tuning.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canVectorizeMatcher(ColumnInspector inspector)
Returns true if this filter can produce a vectorized matcher from its "makeVectorMatcher" method.
|
boolean |
equals(Object o) |
BitmapColumnIndex |
getBitmapColumnIndex(ColumnIndexSelector selector)
Returns a
BitmapColumnIndex if this filter supports using a bitmap index for filtering for the given input
ColumnIndexSelector. |
byte[] |
getCacheKey() |
String |
getDimension() |
com.google.common.collect.RangeSet<String> |
getDimensionRangeSet(String dimension)
Returns a RangeSet that represents the possible range of the input dimension for this DimFilter.This is
applicable to filters that use dimensions such as select, in, bound, and logical filters such as and, or, not.
|
ExtractionFn |
getExtractionFn() |
FilterTuning |
getFilterTuning() |
Set<String> |
getRequiredColumns()
Set of columns used by a filter.
|
SortedSet<String> |
getValues() |
int |
hashCode() |
ValueMatcher |
makeMatcher(ColumnSelectorFactory factory)
Get a ValueMatcher that applies this filter to row values.
|
VectorValueMatcher |
makeVectorMatcher(VectorColumnSelectorFactory factory)
Get a VectorValueMatcher that applies this filter to row vectors.
|
DimFilter |
optimize() |
Filter |
rewriteRequiredColumns(Map<String,String> columnRewrites)
Return a copy of this filter that is identical to the this filter except that it operates on different columns,
based on a renaming map where the key is the column to be renamed in the filter, and the value is the new
column name.
|
boolean |
supportsRequiredColumnRewrite()
Returns true is this filter is able to return a copy of this filter that is identical to this filter except that it
operates on different columns, based on a renaming map.
|
boolean |
supportsSelectivityEstimation(ColumnSelector columnSelector,
ColumnIndexSelector indexSelector)
Indicates whether this filter supports selectivity estimation.
|
Filter |
toFilter()
Returns a Filter that implements this DimFilter.
|
String |
toString() |
toOptimizedFilterclone, finalize, getClass, notify, notifyAll, wait, wait, waitestimateSelectivitypublic InDimFilter(String dimension, InDimFilter.ValuesSet values, @Nullable ExtractionFn extractionFn, @Nullable FilterTuning filterTuning)
dimension - column to searchvalues - set of values to match. This collection may be reused to avoid copying a big collection.
Therefore, callers should not modify the collection after it is passed to this
constructor.extractionFn - extraction function to apply to the column before checking against "values"filterTuning - optional tuningpublic InDimFilter(String dimension, Set<String> values)
dimension - column to searchvalues - set of values to match. If this collection is a SortedSet, it may be reused to avoid
copying a big collection. Therefore, callers should not modify the collection after it
is passed to this constructor.public InDimFilter(String dimension, Collection<String> values, @Nullable ExtractionFn extractionFn)
dimension - column to searchvalues - set of values to match. If this collection is a SortedSet, it may be reused to avoid
copying a big collection. Therefore, callers should not modify the collection after it
is passed to this constructor.extractionFn - extraction function to apply to the column before checking against "values"public String getDimension()
@Nullable public ExtractionFn getExtractionFn()
@Nullable public FilterTuning getFilterTuning()
public byte[] getCacheKey()
getCacheKey in interface Cacheablepublic DimFilter optimize()
public Filter toFilter()
DimFilter@Nullable public com.google.common.collect.RangeSet<String> getDimensionRangeSet(String dimension)
DimFiltergetDimensionRangeSet in interface DimFilterdimension - name of the dimension to get range forpublic Set<String> getRequiredColumns()
FiltergetRequiredColumns in interface DimFiltergetRequiredColumns in interface Filter@Nullable public BitmapColumnIndex getBitmapColumnIndex(ColumnIndexSelector selector)
FilterBitmapColumnIndex if this filter supports using a bitmap index for filtering for the given input
ColumnIndexSelector. The BitmapColumnIndex can be used to compute into a bitmap indicating rows
that match this filter result BitmapColumnIndex.computeBitmapResult(BitmapResultFactory), or examine
details about the index prior to computing it, via BitmapColumnIndex.getIndexCapabilities().getBitmapColumnIndex in interface Filterselector - Object used to create BitmapColumnIndexpublic ValueMatcher makeMatcher(ColumnSelectorFactory factory)
FiltermakeMatcher in interface Filterfactory - Object used to create ValueMatcherspublic VectorValueMatcher makeVectorMatcher(VectorColumnSelectorFactory factory)
FiltermakeVectorMatcher in interface Filterfactory - Object used to create ValueMatcherspublic boolean canVectorizeMatcher(ColumnInspector inspector)
FiltercanVectorizeMatcher in interface Filterinspector - Supplies type information for the selectors this filter will match againstpublic boolean supportsRequiredColumnRewrite()
FiltersupportsRequiredColumnRewrite in interface Filterpublic Filter rewriteRequiredColumns(Map<String,String> columnRewrites)
FilterrewriteRequiredColumns in interface FiltercolumnRewrites - Column rewrite mappublic boolean supportsSelectivityEstimation(ColumnSelector columnSelector, ColumnIndexSelector indexSelector)
FiltersupportsSelectivityEstimation in interface FiltercolumnSelector - Object to check the dimension has multi values.indexSelector - Object used to retrieve bitmap indexesCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.