You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 7, 2025. It is now read-only.
This PR brings a filter pushdown heuristic rule, built on @AveryQi115's
hybrid scheme.
### Filter Pushdown Rule
- This series of rules matches on any filter, and pushes any part of the
filter down below a node if possible.
- They are registered in the HeuristicsRuleWrapper currently, but they
work as cost-based rules as well.
### Helper Functions
- `LogOpExpr::new_flattened_nested_logical` creates a new `LogOpExpr`
from an `ExprList`, and it flattens any nested `LogOpExpr`s of the same
`LogOpType`.
- `Expr::rewrite_column_refs` recursively rewrites any `ColumnExpr` in
an expression tree, using a provided `rewrite_fn`.
- `LogicalJoin::map_through_join` takes in left/right schema sizes, and
maps an index to be as it would if it were pushed down to the left or
right side of a join.
- `LogicalProjection::compute_column_mapping` creates a `ColumnMapping`
object from a `LogicalProjection`.
- The `ColumnMapping` object has a few methods, but most importantly it
has `rewrite_condition`, which given an expr, will rewrite the
expression with the projection's mapping.
### Testing Utilities
- `new_test_optimizer` creates a new heuristic optimizer, which applies
a given rule. It uses a `TpchCatalog`.
- `TpchCatalog` is a catalog implementing a couple of tables from the
TPC-H schema. It can be extended to have more as needed.
- `DummyCostModel` implements a cost model, only giving zero cost. It is
used for constructing a cascades optimizer without a real cost model,
and isn't used in this PR.
- This pull request, using these test optimizer components, pioneers a
new testing scheme, based on running a constructed query plan through an
optimizer, rather than text-based SQL planner tests, which may be flaky.
They also test rules in isolation.
---------
Signed-off-by: AveryQi115 <[email protected]>
Co-authored-by: AveryQi115 <[email protected]>
0 commit comments