Skip to content

Commit

Permalink
Fix BigQuery metadata listing for ambiguous table names
Browse files Browse the repository at this point in the history
Since c9fa5ff metadata listing does not longer call getTableHandle.
Listing columns or tables in BigQuery connector is not failing since for ambiguous tables as
they are filtered out.
  • Loading branch information
wendigo committed Sep 5, 2023
1 parent c76b103 commit bde96c3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ public void testTableNameClash()
// listing must not fail but will filter out ambiguous names
assertThat(computeActual("SHOW TABLES FROM " + schema).getOnlyColumn()).doesNotContain("casesensitivename");
assertQueryReturnsEmptyResult("SELECT table_name FROM information_schema.tables WHERE table_schema = '" + schema + "'");
assertQueryReturnsEmptyResult("SELECT column_name FROM information_schema.columns WHERE table_schema = '" + schema + "' AND table_name = 'casesensitivename'");

// queries which use the ambiguous object must fail
assertQueryFails("SHOW CREATE TABLE " + schema + ".casesensitivename", "Found ambiguous names in BigQuery.*");
assertQueryFails("SHOW COLUMNS FROM " + schema + ".casesensitivename", "Found ambiguous names in BigQuery.*");
assertQueryFails("SELECT column_name FROM information_schema.columns WHERE table_schema = '" + schema + "' AND table_name = 'casesensitivename'", "Found ambiguous names in BigQuery.*");
assertQueryFails("SELECT * FROM " + schema + ".casesensitivename", "Found ambiguous names in BigQuery.*");
// TODO: test with INSERT and CTAS https://github.com/trinodb/trino/issues/6868, https://github.com/trinodb/trino/issues/6869
}
Expand Down

0 comments on commit bde96c3

Please sign in to comment.