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

Isolate selected test from TestCassandraConnectorTest #22592

Merged
Changes from all commits
Commits
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 @@ -1481,20 +1481,23 @@ public void testNativeQuerySelectFromTestTable()
@Test
public void testNativeQueryCaseSensitivity()
{
String tableName = "test_case" + randomNameSuffix();
onCassandra("CREATE TABLE tpch." + tableName + "(col_case BIGINT PRIMARY KEY, \"COL_CASE\" BIGINT)");
onCassandra("INSERT INTO tpch." + tableName + "(col_case, \"COL_CASE\") VALUES (1, 2)");
assertContainsEventually(() -> computeActual("SHOW TABLES FROM cassandra.tpch"), resultBuilder(getSession(), createUnboundedVarcharType())
.row(tableName)
.build(), new Duration(1, MINUTES));
// This test creates columns with names that collide in a way not supported by the connector. Run it exclusively to prevent other tests from failing.
executeExclusively(() -> {
String tableName = "test_case" + randomNameSuffix();
onCassandra("CREATE TABLE tpch." + tableName + "(col_case BIGINT PRIMARY KEY, \"COL_CASE\" BIGINT)");
onCassandra("INSERT INTO tpch." + tableName + "(col_case, \"COL_CASE\") VALUES (1, 2)");
assertContainsEventually(() -> computeActual("SHOW TABLES FROM cassandra.tpch"), resultBuilder(getSession(), createUnboundedVarcharType())
.row(tableName)
.build(), new Duration(1, MINUTES));

assertQuery(
"SELECT * FROM TABLE(cassandra.system.query(query => 'SELECT * FROM tpch." + tableName + "'))",
"VALUES (1, 2)");
assertQuery(
"SELECT * FROM TABLE(cassandra.system.query(query => 'SELECT * FROM tpch." + tableName + "'))",
"VALUES (1, 2)");

onCassandra("DROP TABLE tpch." + tableName);
// Wait until the table becomes invisible to Trino. Otherwise, testSelectInformationSchemaColumns may fail due to ambiguous column names.
assertEventually(() -> assertThat(getQueryRunner().tableExists(getSession(), tableName)).isFalse());
onCassandra("DROP TABLE tpch." + tableName);
// Wait until the table becomes invisible to Trino. Otherwise, testSelectInformationSchemaColumns may fail due to ambiguous column names.
assertEventually(() -> assertThat(getQueryRunner().tableExists(getSession(), tableName)).isFalse());
});
}

@Test
Expand Down
Loading