Skip to content
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

Dynamic information_schema configuration and port more tests #4722

Merged
merged 2 commits into from
Dec 26, 2022

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Dec 23, 2022

Which issue does this PR close?

Part of #4495

Rationale for this change

Currently the information schema can not be enabled after the SessionState is created and it can not be disabled.

This means I can't enable it programmatically in the sqllogicttests, and makes for a strange user experience where you can run set datafusion.catalog.information_schema = true but it is a noop

What changes are included in this PR?

  1. Enable / Disable information schema dynamically
  2. Port some information_schema tests that rely on this behavior

Are these changes tested?

Yes

Are there any user-facing changes?

Users can now enable / disable the information schema

Example:

DataFusion CLI v15.0.0
❯ show tables;
+---------------+--------------------+-------------+------------+
| table_catalog | table_schema       | table_name  | table_type |
+---------------+--------------------+-------------+------------+
| datafusion    | information_schema | tables      | VIEW       |
| datafusion    | information_schema | views       | VIEW       |
| datafusion    | information_schema | columns     | VIEW       |
| datafusion    | information_schema | df_settings | VIEW       |
+---------------+--------------------+-------------+------------+
4 rows in set. Query took 0.045 seconds.
❯ set datafusion.catalog.information_schema = false;
0 rows in set. Query took 0.001 seconds.
❯ show tables;
Plan("SHOW TABLES is not supported unless information_schema is enabled")

@github-actions github-actions bot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Dec 23, 2022
};
catalog_list
.register_catalog(config.default_catalog.clone(), default_catalog);
catalog_list.register_catalog(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The InformationSchema changes are now handed in update_information_schema

@alamb alamb force-pushed the alamb/dynamic_information_schema branch from 3efcfb7 to 936a704 Compare December 23, 2022 22:55
@@ -30,91 +30,6 @@ use rstest::rstest;

use super::*;

#[tokio::test]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ported a few tests over to show the behavior -- I will port what else I can from this file as a follow on PR

@@ -130,12 +130,6 @@ async fn context_for_test_file(file_name: &str) -> SessionContext {
setup::register_aggregate_tables(&ctx).await;
ctx
}
"information_schema.slt" => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is now controllable dynamically, we do not have to hard code the sqltest runner

@alamb alamb marked this pull request as ready for review December 23, 2022 22:58
@alamb
Copy link
Contributor Author

alamb commented Dec 23, 2022

FYI @tustvold

@alamb alamb requested a review from xudong963 December 23, 2022 22:58
Copy link
Member

@xudong963 xudong963 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@alamb
Copy link
Contributor Author

alamb commented Dec 24, 2022

cc @mvanschellebeeck

@alamb alamb merged commit 34475bb into apache:master Dec 26, 2022
@ursabot
Copy link

ursabot commented Dec 26, 2022

Benchmark runs are scheduled for baseline = fe3f018 and contender = 34475bb. 34475bb is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@alamb alamb deleted the alamb/dynamic_information_schema branch August 8, 2023 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants