nastra commented on code in PR #9487:
URL: https://github.com/apache/iceberg/pull/9487#discussion_r1484299675


##########
core/src/test/java/org/apache/iceberg/jdbc/TestJdbcCatalog.java:
##########
@@ -158,6 +162,66 @@ public void testInitialize() {
     jdbcCatalog.initialize("test_jdbc_catalog", properties);
   }
 
+  @Test
+  public void testSchemaUpdate() throws Exception {

Review Comment:
   I would probably slightly change this to something like:
   ```
   @Test
     public void schemaIsMigratedToAddViewSupport() throws Exception {
       // as this test uses different connection, we can't use memory database 
(as it's per
       // connection), but a
       // file database instead
       java.nio.file.Path dbFile = Files.createTempFile("icebergSchemaUpdate", 
"db");
       String jdbcUrl = "jdbc:sqlite:" + dbFile.toAbsolutePath();
   
       initLegacySchema(jdbcUrl);
   
       Map<String, String> properties = Maps.newHashMap();
       properties.put(CatalogProperties.WAREHOUSE_LOCATION, 
this.tableDir.toAbsolutePath().toString());
       properties.put(CatalogProperties.URI, jdbcUrl);
       properties.put(JdbcUtil.ADD_VIEW_SUPPORT_PROPERTY, "true");
       JdbcCatalog jdbcCatalog = new JdbcCatalog();
       jdbcCatalog.setConf(conf);
       jdbcCatalog.initialize("TEST", properties);
   
       TableIdentifier tableOne = TableIdentifier.of("namespace1", "table1");
       TableIdentifier tableTwo = TableIdentifier.of("namespace2", "table2");
       assertThat(jdbcCatalog.listTables(Namespace.of("namespace1")))
           .hasSize(1)
           .containsExactly(tableOne);
   
       assertThat(jdbcCatalog.listTables(Namespace.of("namespace2")))
           .hasSize(1)
           .containsExactly(tableTwo);
   
       assertThat(jdbcCatalog.listViews(Namespace.of("namespace1"))).isEmpty();
   
       TableIdentifier view = TableIdentifier.of("namespace1", "view");
       jdbcCatalog
           .buildView(view)
           .withQuery("spark", "select * from tbl")
           .withSchema(SCHEMA)
           .withDefaultNamespace(Namespace.of("namespace1"))
           .create();
   
       
assertThat(jdbcCatalog.listViews(Namespace.of("namespace1"))).hasSize(1).containsExactly(view);
     }
   ```



-- 
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

Reply via email to