Package org.apache.druid.query.filter
Class FilterBundle
- java.lang.Object
-
- org.apache.druid.query.filter.FilterBundle
-
public class FilterBundle extends Object
FilterBundle is a container for all the goodies used for producing filtered cursors, aImmutableBitmapif the filter can use an index, and/or aFilterBundle.MatcherBundlewhich contains functions to buildValueMatcherandVectorValueMatcherfor 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 Classes Modifier and Type Class Description static classFilterBundle.BundleInfostatic interfaceFilterBundle.IndexBundlestatic classFilterBundle.IndexBundleInfostatic interfaceFilterBundle.MatcherBundleBuilder ofValueMatcherandVectorValueMatcher.static classFilterBundle.MatcherBundleInfostatic classFilterBundle.SimpleIndexBundlestatic classFilterBundle.SimpleMatcherBundle
-
Constructor Summary
Constructors Constructor Description FilterBundle(FilterBundle.IndexBundle index, FilterBundle.MatcherBundle matcherBundle)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FilterBundleallFalse(long constructionTime, ImmutableBitmap emptyBitmap)FilterBundle.IndexBundlegetIndex()FilterBundle.BundleInfogetInfo()FilterBundle.MatcherBundlegetMatcherBundle()booleanhasIndex()booleanhasMatcher()
-
-
-
Constructor Detail
-
FilterBundle
public FilterBundle(@Nullable FilterBundle.IndexBundle index, @Nullable FilterBundle.MatcherBundle matcherBundle)
-
-
Method Detail
-
allFalse
public static FilterBundle allFalse(long constructionTime, ImmutableBitmap emptyBitmap)
-
getIndex
@Nullable public FilterBundle.IndexBundle getIndex()
-
getMatcherBundle
@Nullable public FilterBundle.MatcherBundle getMatcherBundle()
-
getInfo
public FilterBundle.BundleInfo getInfo()
-
hasIndex
public boolean hasIndex()
-
hasMatcher
public boolean hasMatcher()
-
-