-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Added BaseConnectorSmokeTest for Analyze to test different catalogs #27322
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
base: master
Are you sure you want to change the base?
Conversation
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
| "NOT_SUPPORTED"); | ||
| } | ||
| finally { | ||
| assertUpdate("DROP TABLE IF EXISTS " + tableName); |
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.
Could you use TestTable class instead?
| assertThat(query("SELECT count(*) FROM " + tableName)) | ||
| .matches("VALUES BIGINT '25'"); |
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.
No need to verify the row count. I would remove this assertion.
| assertThat(computeActual("SHOW STATS FOR " + tableName).getRowCount()) | ||
| .as("Statistics should be collected after ANALYZE") | ||
| .isGreaterThan(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.
Could you verify distinct_values_count field instead of the row count?
| String tableName = "test_analyze_" + randomNameSuffix(); | ||
|
|
||
| try { | ||
| assertUpdate("CREATE TABLE " + tableName + " AS SELECT * FROM nation", 25); |
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.
We should verify the following ANALYZE collected NDV. Could you use a session disabling collect_extended_statistics_on_write property?
| .containsAnyOf( | ||
| "S3 Tables do not support analyze", | ||
| "do not support analyze", | ||
| "NOT_SUPPORTED"); |
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.
We could add a helper method (e.g. errorMessageForAnalyze) and make unsupported test classes override the method.
| } | ||
| } | ||
|
|
||
| @Test |
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.
Added BaseConnectorSmokeTest for Analyze to test different catalogs
Could you change both PR and commit title to "Test ANALYZE in BaseIcebergConnectorSmokeTest"?
Description
This PR adds a test case to BaseConnectorSmokeTest testing that analyze works correctly if the connector supports the operation. If the test fails then it is because of lack of support so the test will then check that the test is indeed true for the underlying connector.
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: