amogh-jahagirdar commented on code in PR #9247: URL: https://github.com/apache/iceberg/pull/9247#discussion_r1427359104
########## core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java: ########## @@ -1669,4 +1669,52 @@ public void concurrentReplaceViewVersion() { .build()); } } + + @Test + public void testSqlForMultipleDialects() { + TableIdentifier identifier = TableIdentifier.of("ns", "view"); + + if (requiresNamespaceCreate()) { + catalog().createNamespace(identifier.namespace()); + } + + View view = + catalog() + .buildView(identifier) + .withSchema(SCHEMA) + .withDefaultNamespace(identifier.namespace()) + .withDefaultCatalog(catalog().name()) + .withQuery("spark", "select * from ns.tbl") + .withQuery("trino", "select * from ns.tbl using X") + .create(); + + assertThat(view.sqlFor("spark").sql()).isEqualTo("select * from ns.tbl"); + assertThat(view.sqlFor("trino").sql()).isEqualTo("select * from ns.tbl using X"); + assertThat(view.sqlFor("unknown-dialect").sql()).isEqualTo("select * from ns.tbl"); + } + + @Test + public void testSqlForInvalidArguments() { + TableIdentifier identifier = TableIdentifier.of("ns", "view"); + + if (requiresNamespaceCreate()) { + catalog().createNamespace(identifier.namespace()); + } + + View view = Review Comment: It looks like we can rely on catalog cleanup because the different extensions AfterEach will close (which clears the state from the catalog). So I don't think there's really any need for explicitly dropping the view for these new tests -- 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