public class FilterCompat extends Object
org.apache.parquet.filter. The new API (found in filter2) supports
also filtering entire rowgroups of records without reading them at all.
This class defines a common interface that both of these filters share,
FilterCompat.Filter. A Filter can be either an UnboundRecordFilter from the old API, or
a FilterPredicate from the new API, or a sentinel no-op filter.
Having this common interface simplifies passing a filter through the read path of parquet's codebase.
| Modifier and Type | Class and Description |
|---|---|
static interface |
FilterCompat.Filter |
static class |
FilterCompat.FilterPredicateCompat |
static class |
FilterCompat.NoOpFilter |
static class |
FilterCompat.UnboundRecordFilterCompat |
static interface |
FilterCompat.Visitor<T>
Anyone wanting to use a
FilterCompat.Filter need only implement this interface,
per the visitor pattern. |
| Modifier and Type | Field and Description |
|---|---|
static FilterCompat.Filter |
NOOP |
| Constructor and Description |
|---|
FilterCompat() |
| Modifier and Type | Method and Description |
|---|---|
static FilterCompat.Filter |
get(FilterPredicate filterPredicate)
Given a FilterPredicate, return a Filter that wraps it.
|
static FilterCompat.Filter |
get(FilterPredicate filterPredicate,
UnboundRecordFilter unboundRecordFilter)
Given either a FilterPredicate or the class of an UnboundRecordFilter, or neither (but not both)
return a Filter that wraps whichever was provided.
|
static FilterCompat.Filter |
get(UnboundRecordFilter unboundRecordFilter)
Given an UnboundRecordFilter, return a Filter that wraps it.
|
public static final FilterCompat.Filter NOOP
public static FilterCompat.Filter get(FilterPredicate filterPredicate)
filterPredicate - a filter predicatepublic static FilterCompat.Filter get(UnboundRecordFilter unboundRecordFilter)
unboundRecordFilter - an unbound record filterpublic static FilterCompat.Filter get(FilterPredicate filterPredicate, UnboundRecordFilter unboundRecordFilter)
Either filterPredicate or unboundRecordFilterClass must be null, or an exception is thrown.
If both are null, the no op filter will be returned.
filterPredicate - a filter predicate, or nullunboundRecordFilter - an unbound record filter, or nullCopyright © 2019 The Apache Software Foundation. All rights reserved.