Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion crates/core/common/src/context/session_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,21 @@ impl SessionState {

/// Applies DataFusion logical optimizations to an existing plan.
///
/// Runs custom pre-optimisation rewrites (filter pushthrough for
/// `evm_decode`) before delegating to DataFusion's standard optimizer.
/// This ensures derived predicates participate in predicate pushdown.
///
/// Does not trigger SQL pre-resolution; the plan is assumed to be fully
/// resolved already.
///
/// Mirrors [`DfSessionState::optimize`] (synchronous).
#[tracing::instrument(skip_all, err)]
pub fn optimize(&self, plan: &LogicalPlan) -> Result<LogicalPlan, DataFusionError> {
self.state.optimize(plan)
let plan = {
let _span = tracing::debug_span!("filter_pushthrough_decode").entered();
crate::filter_pushthrough_decode::filter_pushthrough_decode(plan.clone())?
};
self.state.optimize(&plan)
}

/// Returns a new `SessionState` with async catalog pre-resolution
Expand Down
Loading
Loading