-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Cleanup InformationSchema plumbing #4740
Cleanup InformationSchema plumbing #4740
Conversation
@@ -20,7 +20,7 @@ | |||
|
|||
#![allow(clippy::module_inception)] | |||
pub mod catalog; | |||
pub mod information_schema; | |||
pub(crate) mod information_schema; |
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.
There wasn't anything public in the module so we might as well just make it crate private
https://docs.rs/datafusion/latest/datafusion/catalog/information_schema/index.html
@@ -1721,6 +1653,12 @@ impl SessionState { | |||
table_ref: impl Into<TableReference<'a>>, | |||
) -> Result<Arc<dyn SchemaProvider>> { | |||
let resolved_ref = self.resolve_table_ref(table_ref); | |||
if self.config.information_schema() && resolved_ref.schema == INFORMATION_SCHEMA { | |||
return Ok(Arc::new(InformationSchemaProvider::new( |
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.
This is cool -- it makes the information schema provider on demand 👍
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.
There is good test coverage of information schema in https://github.com/apache/arrow-datafusion/blob/master/datafusion/core/tests/sql/information_schema.rs and https://github.com/apache/arrow-datafusion/blob/master/datafusion/core/tests/sqllogictests/test_files/information_schema.slt
Thank you for the cleanup @tustvold
Benchmark runs are scheduled for baseline = 9046a8a and contender = 8c0c0ad. 8c0c0ad is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #.
Rationale for this change
This follows on from #4606 and #4722 and simplifies the handling of information schema
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?