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

Add test for renameTable in Faker connector #24599

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sthandassery
Copy link
Contributor

@sthandassery sthandassery commented Dec 31, 2024

Description

Adding unit test coverage for renameTable method in Faker connector.

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

Copy link

cla-bot bot commented Dec 31, 2024

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 [email protected]. 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

@ebyhr
Copy link
Member

ebyhr commented Dec 31, 2024

Fixes #23911

Please don't use "Fixes" comment. We should add more tests in #23911.

Copy link

cla-bot bot commented Dec 31, 2024

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 [email protected]. 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

@sthandassery sthandassery force-pushed the unit-test-faker-rename-table branch from 968ea30 to f5c25ca Compare December 31, 2024 21:55
Copy link

cla-bot bot commented Dec 31, 2024

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 [email protected]. 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

@sthandassery
Copy link
Contributor Author

sthandassery commented Dec 31, 2024

@nineinchnick can you take another look at this with those additional assertions?

@Test
void testRenameTable()
{
assertUpdate("CREATE TABLE faker.default.original_table (id INTEGER, name VARCHAR)");
Copy link
Member

Choose a reason for hiding this comment

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

faker.default is the default catalog and schema name in this test class. No need to repeat that. Please remove it.

// should not allow renaming to an already existing table.
assertQueryFails("ALTER TABLE faker.default.renamed_table RENAME TO faker.default.renamed_table", "line 1:1: Target table 'faker.default.renamed_table' already exists");
assertUpdate("DROP TABLE faker.default.renamed_table");
}
Copy link
Member

Choose a reason for hiding this comment

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

Please add another test (testRenameTableAcrossSchema) renaming it to a different schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants