refactor: move catalog traits to session crate#23703
Draft
timsaucer wants to merge 1 commit into
Draft
Conversation
Move catalog, schema, table provider, and table function contracts into datafusion-session while preserving datafusion-catalog re-exports. Expose catalog access as a required Session capability, including across ForeignSession and the FFI boundary. AI Disclosure: This code was written in part by an AI agent.
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #23703 +/- ##
==========================================
- Coverage 80.67% 80.67% -0.01%
==========================================
Files 1088 1088
Lines 367591 367648 +57
Branches 367591 367648 +57
==========================================
+ Hits 296563 296592 +29
- Misses 53374 53397 +23
- Partials 17654 17659 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
timsaucer
commented
Jul 20, 2026
Comment on lines
+84
to
+85
| /// Return the catalogs registered with this session. | ||
| fn catalog_list(&self) -> Arc<dyn CatalogProviderList>; |
Member
Author
There was a problem hiding this comment.
This new function on the Session trait is the main point of this PR. The other code is moved around to support the dependency requirements.
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?
Rationale for this change
This will enable users to create table views using table function over an existing table in the catalog via FFI. We are currently unable to access the catalog other than by downcasting a
SessiontoSessionState, which is not effective over FFI.In order to support this, we need to move many trait definitions out of the
datafusion-catalogcrate and into thedatafusion-sessioncrate. There is more discussion in #23678 about why this is necessary.What changes are included in this PR?
datafusion-session.catalog()function toSession.catalog()inForeignSessionfor FFI usersAre these changes tested?
New tests are included.
Are there any user-facing changes?
User guide is updated.