@PublicEvolving public interface SupportsFilterPushDown
ScanTableSource
.
Given the following SQL:
SELECT * FROM t WHERE (a = '1' OR a = '2') AND b IS NOT NULL;
In the example above, [a = '1' OR a = '2']
and [b IS NOT NULL]
are acceptable
filters.
By default, if this interface is not implemented, filters are applied in a subsequent operation after the source.
For efficiency, a source can push filters further down in order to be close to the actual data generation. The passed filters are translated into conjunctive form. A source can pick filters and return the accepted and remaining filters.
Accepted filters are filters that are consumed by the source but may be applied on a best effort basis. The information about accepted filters helps the planner to adjust the cost estimation for the current plan. A subsequent filter operation will still take place by the runtime depending on the remaining filters.
Remaining filters are filters that cannot be fully applied by the source. The remaining filters decide if a subsequent filter operation will still take place by the runtime.
By the above definition, accepted filters and remaining filters must not be disjunctive lists. A filter can occur in both list. However, all given filters must be present in at least one list.
Note: A source is not allowed to change the given expressions in the returned SupportsFilterPushDown.Result
.
Use ExpressionVisitor
to traverse filter expressions.
Modifier and Type | Interface and Description |
---|---|
static class |
SupportsFilterPushDown.Result
Result of a filter push down.
|
Modifier and Type | Method and Description |
---|---|
SupportsFilterPushDown.Result |
applyFilters(List<ResolvedExpression> filters)
Provides a list of filters in conjunctive form.
|
SupportsFilterPushDown.Result applyFilters(List<ResolvedExpression> filters)
See the documentation of SupportsFilterPushDown
for more information.
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.