-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Expose catalog through table func context #2172
Conversation
Also adds back temp catalog to session extensions.
// Note that we're not changing out the catalog stored on the context | ||
// here. The session's catalog will get swapped out at the beginning of | ||
// the next query execution. | ||
// | ||
// TODO: We should be returning _what_ was updated from metastore | ||
// instead of needing to do this. Sean has a stash working on this. | ||
let new_catalog = SessionCatalog::new( | ||
state, | ||
ResolveConfig { | ||
default_schema_oid: 0, | ||
session_schema_oid: 0, | ||
}, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Been looking at this & i don't think i fully understand the ResolveConfig
and what's happening here.
AFAIK, the ResolveConfig
is just a config object containing the global schema and session ids?
Why are we setting them to 0
here? Is this just a temporary workaround?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep that's pretty much it. The resolve config here is set to zeros since we don't actually need them, we're just creating a new session catalog to pull out the new table entry that metastore just created.
And sqlbuiltins
is now importing quite a few crates which make it tricky to import into the catalog
crate (cycle) and so I had to resort to the resolve config. I want to look at possibly splitting up sqlbuiltins
to avoid that cycle, but figured it'd be a bit of a refactor.
Exposes the session catalog through the table func context provider.
Also a bit of refactoring here and there.