-
Notifications
You must be signed in to change notification settings - Fork 566
Open
Description
What happened?
Builders like OptimizeBuilder, MergeBuilder, UpdateBuilder accept Arc via with_session_state(...), but internally require a concrete SessionState. When the downcast fails, they silently fall back to an internal default:
session.as_any().downcast_ref::<SessionState>()
.cloned()
.unwrap_or_else(|| create_internal_session_state(...))
Relevant paths:
- crates/core/src/operations/optimize.rs
- crates/core/src/operations/merge/mod.rs
- crates/core/src/operations/update.rs
The operation "works", but caller-provided config/runtime/registrations get silently ignored.
Expected behavior
Either accept SessionState directly, error when downcast fails, or at minimum log/document that fallback happened.
Operating System
All (API-level behavior)
Binding
Rust
Bindings Version
Observed on main / DF52 upgrade work (DataFusion 52).
Steps to reproduce
- Create a session with custom config (runtime env, target partitions, UDF registrations, etc.)
- Pass it to OptimizeBuilder::with_session_state(...) as Arc where concrete type isn't SessionState
- Operation runs with internal defaults instead of caller's session - no warning
Relevant logs
N/A (the problem is the absence of any warning/error when fallback happens)
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status