Package org.apache.druid.query.filter
Class FilterBundle
java.lang.Object
org.apache.druid.query.filter.FilterBundle
FilterBundle is a container for all the goodies used for producing filtered cursors, a
ImmutableBitmap if
the filter can use an index, and/or a FilterBundle.MatcherBundle which contains functions to build ValueMatcher
and VectorValueMatcher for any filters which must be evaluated row by row during the cursor scan. Cursors
will use everything that is non-null, and at least one of index or matcher bundle MUST be set. If both index and
matcher is present, the cursor will effectively perform a logical AND operation; i.e. if the index matches a row
then the value matcher must also match the row for the cursor to provide it to the selectors built on top of it.
There are a few cases where the filter should set both indexes and matchers. For example, if the filter is a
composite filter which can be partitioned, such as AndFilter, then the filter
can be partitioned due to the intersection nature of AND, so the index can be set to reduce the number of rows and
the matcher bundle will build a matcher which will filter the remainder. This strategy of having both an index and a
matcher can also can model the case where the index is an inexact match and so a matcher must be used to ensure that
the remaining values actually match the filter.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classWraps info needed to build aFilterBundle, and provides an estimated compute cost forBitmapColumnIndex.computeBitmapResult(org.apache.druid.query.BitmapResultFactory<T>, boolean).static classstatic interfacestatic classstatic interfaceBuilder ofValueMatcherandVectorValueMatcher.static classstatic classstatic class -
Constructor Summary
ConstructorsConstructorDescriptionFilterBundle(FilterBundle.IndexBundle index, FilterBundle.MatcherBundle matcherBundle) -
Method Summary
Modifier and TypeMethodDescriptionstatic FilterBundleallFalse(long constructionTime, ImmutableBitmap emptyBitmap) booleangetIndex()getInfo()booleanhasIndex()boolean
-
Constructor Details
-
FilterBundle
public FilterBundle(@Nullable FilterBundle.IndexBundle index, @Nullable FilterBundle.MatcherBundle matcherBundle)
-
-
Method Details
-
allFalse
-
getIndex
-
getMatcherBundle
-
getInfo
-
hasIndex
public boolean hasIndex() -
hasMatcher
public boolean hasMatcher() -
canVectorizeMatcher
public boolean canVectorizeMatcher()
-