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
feat: let extension bundles declare physical optimizer rules
`SessionExtensionComponents.physical_optimizer_rules` completes the group of
components whose capsule getter takes no argument, so a library shipping a rule
alongside anything else no longer asks the caller for a separate
`add_physical_optimizer_rule` call.
Rules are the one kind with no collision rule: they accumulate rather than
replace, so two bundles contributing one each is the normal case and there is
nothing to refuse.
Installing them splits across the two new private primitives
`_resolve_extension_physical_optimizer_rules` and
`_install_extension_physical_optimizer_rules`, keeping the commit step
infallible: the capsules are imported during resolution, so a rule that fails
to import cannot leave the session with a planner already bound. All the rules
in one call go on in a single `SessionState` rebuild.
`add_physical_optimizer_rule` rebuilds per call, which for a bundle with
several would clone the whole state that many times and leave the earlier ones
installed if a later one failed. The session id is carried across the rebuild
for the same reason that method carries it.
`PhysicalOptimizerRuleExportable` moves from `datafusion.context` to
`datafusion.extensions`, alongside the rest of the protocol family, and is now
exported from the package root. It stays importable from `datafusion.context`.
`MyRuleExtension` in `datafusion-ffi-example` declares two rules, which is what
makes accumulation observable — each carries its own counter and both fire.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments