Repository navigation
feat: preserve session state when replacing its runtime - #179
Merged
Vedin merged 1 commit intoNov 6, 2026
Merged
Conversation
Vedin
marked this pull request as ready for review
November 6, 2026 18:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
No separate issue; this supplies the runtime/parser prerequisites for the Rustice Oracle internal-stage workstream.
Rationale for this change
A query that needs private object stores must retain the existing session's configured functions, aliases and planning state. Rebuilding through SessionStateBuilder can re-enroll function aliases, apply configuration callbacks again and reset state. A runtime-only replacement provides an explicit alternative.
What changes are included in this PR?
Add consuming SessionState::with_runtime_env(Arc), changing only the runtime field. Document that existing plans/providers may retain old resources and that the caller must supply the resources required by the preserved state. Pin the workspace parser coherently to merged sqlparser #44 for typed Snowflake PUT/GET operands; the lockfile delta is Git source IDs only.
Are these changes tested?
The tests-first baseline fails on the missing API. New tests preserve exact function/alias instances, configured callbacks, config extensions, session ID, catalog/planner/prepared-plan registries and original-runtime isolation. Rust 1.97 formatting and workspace/all-target/all-feature Clippy with -D warnings pass. The required extended workspace command passes 10,763 libtests, zero failures and ten ignored tests across 72 harnesses; the SQLLogicTest harness also completes all 509 files. The unmodified full standard ./dev/rust_lint.sh also passes: formatting, its Clippy configuration, TOML formatting, licenses, spelling, documentation formatting, workflow checks and workspace rustdoc with warnings denied.
Remote Rust CI passes all 25 jobs, including tests, Clippy, MSRV, examples, documentation, feature checks and Postgres/Substrait runners. Dev, dependencies, Docs, CodeQL and large-file checks pass. All three additional extended jobs now pass, including hash collisions and the SQLite corpus; SQLite completed after merge. Required local extended acceptance above is complete. Security audit reports the same advisory IDs as the previous pin baseline: 15 vulnerabilities and 15 allowed warnings in unchanged dependency versions (job); no audit suppression or disabled check is introduced.
The PR targets the active
df55-physical-udf-instancecompatibility branch. A main-only semver run dispatched during initial creation against the oldermainwas cancelled after retargeting; that comparison is outside this change. The qualified head and current CI merge-ref trees are identical.No existing benchmark directly measures this new opt-in setter; adjacent planner benchmarks require external fixtures or measure optimization. No query-kernel/default path or performance improvement is claimed.
Are there any user-facing changes?
An additive opt-in SessionState API and the parser pin. The merge retains the qualified head in history so downstream can pin that exact immutable, tested source. The method preserves existing state instances and does not rebuild or retroactively retarget existing plans/providers. Store/pool/cache configuration remains the caller's responsibility. Runtime authorization and file-transfer execution remain in the consuming engine.