Interface SupportsFilterPushDown
-
- All Known Implementing Classes:
FileSystemTableSource
@PublicEvolving public interface SupportsFilterPushDown
Enables to push down filters into aScanTableSource
.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SupportsFilterPushDown.Result
Result of a filter push down.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SupportsFilterPushDown.Result
applyFilters(List<ResolvedExpression> filters)
Provides a list of filters in conjunctive form.
-
-
-
Method Detail
-
applyFilters
SupportsFilterPushDown.Result applyFilters(List<ResolvedExpression> filters)
Provides a list of filters in conjunctive form. A source can pick filters and return the accepted and remaining filters.See the documentation of
SupportsFilterPushDown
for more information.
-
-