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)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]