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
Allow logical optimizer to be run without evaluating now() & refactor SimplifyInfo (#19505)
In trying to fix#19418 I kept getting turned around about what was
needed where. The `SimplifyInfo` trait made it extra hard to understand.
I ended up realizing that the main reason for the trait to exist was
tests. Removing the trait and adding a builder style API to
`SimplifyContext` made it IMO more ergonomic for tests and other call
sites, easier to track the code (no trait opaqueness) and clearer what
simplification capabilities are available in each site. This got rid of
e.g. some places where we were calling `ExecutionProps::new()` just to
pass that into `SimplifyContext` which in turn would hand out references
to the default query time, a default `ContigOptions`, etc; or in
`datafusion/core/src/execution/session_state.rs` where we did `let
dummy_schema = DFSchema::empty()`.
This let me solve several problems:
- Can store optimized logical plans for prepared statements
- Users can optionally run an optimizer pass on logical plans without
evaluating time functions
Compared to #19426 this avoids adding a config option and is actually
less lines of code (negative diff).
Fixes#19418, closes#19426 (replaces it).
---------
Co-authored-by: Claude Opus 4.5 <[email protected]>
0 commit comments