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 4 commits
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,28 @@
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");
Copy link
Member

Choose a reason for hiding this comment

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

This is not formatted correctly, you need to add one more space for indentation. Try setting up your IDE to format all files automatically.

assertUpdate("CREATE TABLE faker.default.original_table (id INTEGER, name VARCHAR)");
assertQuery("SHOW TABLES FROM faker.default", "VALUES 'original_table'");

Check failure on line 44 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_091030_00011_dhfkt: 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)");
assertUpdate("ALTER TABLE faker.default.test_table SET PROPERTIES default_limit = 100");
assertQuery("SELECT table_property_name, table_property_value FROM information_schema.tables WHERE table_name = 'test_table' AND table_property_name = 'default_limit'","VALUES ('default_limit', '100')");

Check failure on line 57 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

Execution of 'actual' query 20241029_091030_00017_dhfkt failed: SELECT table_property_name, table_property_value FROM information_schema.tables WHERE table_name = 'test_table' AND table_property_name = 'default_limit'
assertUpdate("DROP TABLE faker.default.test_table");
}

@Test
void testSelectFromTable()
Expand Down Expand Up @@ -194,7 +216,7 @@
assertQuery(testQuery, "VALUES (1000)");
assertUpdate("DROP TABLE faker.default.single_column");
}

@Test
void testSelectDefaultTableLimit()
{
Expand Down
Loading