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

Added test for rename and set properties TestFakerQueries.java #23950

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,30 @@
assertUpdate("CREATE TABLE faker.default.test (id INTEGER, name VARCHAR)");
assertTableColumnNames("faker.default.test", "id", "name");
}
@Test
kavyabala23 marked this conversation as resolved.
Show resolved Hide resolved
void testRenameTable()
{
assertQuery("SHOW TABLES FROM faker.default LIKE 'original_table'", "SELECT '' WHERE false");
assertUpdate("CREATE TABLE faker.default.original_table (id INTEGER, name VARCHAR)");
assertQuery("SHOW TABLES FROM faker.default", "VALUES 'original_table'");

Check failure on line 43 in plugin/trino-faker/src/test/java/io/trino/plugin/faker/TestFakerQueries.java

View workflow job for this annotation

GitHub Actions / test-other-modules

TestFakerQueries.testRenameTable

For query 20241029_050213_00011_d95x8: SHOW TABLES FROM faker.default not equal Actual rows (up to 100 of 2 extra rows shown, 3 rows in total): [all_types] [single_column] Expected rows (up to 100 of 0 missing rows shown, 1 rows in total):
assertUpdate("ALTER TABLE faker.default.original_table RENAME TO renamed_table");
assertQuery("SHOW TABLES FROM faker.default LIKE 'renamed_table'", "VALUES 'renamed_table'");
assertQuery("SHOW TABLES FROM faker.default LIKE 'original_table'", "SELECT '' WHERE false");
assertUpdate("DROP TABLE faker.default.renamed_table");
}
@Test
void testAlterTableSetProperties()
{
assertQuery("SHOW TABLES FROM faker.default LIKE 'test_table'", "SELECT '' WHERE false");
assertUpdate("CREATE TABLE faker.default.test_table (id INTEGER, name VARCHAR)");
assertQuery("SHOW TABLES FROM faker.default", "VALUES 'test_table'");

Check failure on line 54 in plugin/trino-faker/src/test/java/io/trino/plugin/faker/TestFakerQueries.java

View workflow job for this annotation

GitHub Actions / test-other-modules

TestFakerQueries.testAlterTableSetProperties

For query 20241029_050213_00014_d95x8: SHOW TABLES FROM faker.default not equal Actual rows (up to 100 of 3 extra rows shown, 4 rows in total): [all_types] [all_types_range] [original_table] Expected rows (up to 100 of 0 missing rows shown, 1 rows in total):
assertUpdate("ALTER TABLE faker.default.test_table SET PROPERTIES comment = 'This is a test table'");
Copy link
Member

Choose a reason for hiding this comment

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

The connector doesn't support setting comment table property. It should be null_probability or default_limit.

assertQuery(
"SHOW CREATE TABLE faker.default.test_table",
"VALUES 'CREATE TABLE faker.default.test_table (id INTEGER, name VARCHAR) WITH (comment = ''This is a test table'')'"
);
assertUpdate("DROP TABLE faker.default.test_table");
}

@Test
void testSelectFromTable()
Expand Down
Loading