thomaschow commented on code in PR #14113: URL: https://github.com/apache/iceberg/pull/14113#discussion_r2363416667
########## bigquery/src/test/java/org/apache/iceberg/gcp/bigquery/TestBigQueryCatalog.java: ########## @@ -171,4 +181,85 @@ public void renameTableNamespaceMissing() { public void testRenameTableMissingSourceTable() { super.testRenameTableMissingSourceTable(); } + + @Test + public void testIsValidIdentifierWithValidSingleLevelNamespace() { + TableIdentifier validIdentifier = TableIdentifier.of("dataset1", "table1"); + assertThat(catalog.isValidIdentifier(validIdentifier)).isTrue(); + } + + @Test + public void testIsValidIdentifierWithInvalidMultiLevelNamespace() { + TableIdentifier invalidIdentifier = + TableIdentifier.of(Namespace.of("level1", "level2"), "table1"); + assertThat(catalog.isValidIdentifier(invalidIdentifier)).isFalse(); + } + + @Test + public void testIsValidIdentifierWithThreeLevelNamespace() { + TableIdentifier invalidIdentifier = + TableIdentifier.of(Namespace.of("level1", "level2", "level3"), "table1"); + assertThat(catalog.isValidIdentifier(invalidIdentifier)).isFalse(); + } + + @Test + public void testIsValidIdentifierWithEmptyNamespace() { + TableIdentifier invalidIdentifier = TableIdentifier.of(Namespace.empty(), "table1"); + assertThat(catalog.isValidIdentifier(invalidIdentifier)).isFalse(); + } + + @Test + public void testLoadMetadataTableIsCalled() { Review Comment: I want to test that loading a metadata table will actually happen with the fix in place, since that's technically a valid case of specifying an invalid table name. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org