nastra commented on code in PR #10124:
URL: https://github.com/apache/iceberg/pull/10124#discussion_r1562357647
##########
core/src/test/java/org/apache/iceberg/jdbc/TestJdbcCatalog.java:
##########
@@ -161,6 +161,19 @@ public void testInitialize() {
jdbcCatalog.initialize("test_jdbc_catalog", properties);
}
+ @Test
+ public void testDisableInitCatalogTables() {
+ Map<String, String> properties = Maps.newHashMap();
+ properties.put(CatalogProperties.WAREHOUSE_LOCATION,
this.tableDir.toAbsolutePath().toString());
+ properties.put(CatalogProperties.URI,
"jdbc:sqlite:file::memory:?icebergDB");
+ properties.put(JdbcUtil.INIT_CATALOG_TABLES_PROPERTY, "false");
+
+ JdbcCatalog jdbcCatalog = new JdbcCatalog();
+ jdbcCatalog.initialize("test_jdbc_catalog", properties);
+
+ assertThat(jdbcCatalog.getInitializeCatalogTables()).isFalse();
Review Comment:
instead of checking this flag you might rather want to run a SQL that makes
sure the respective catalog tables don't exist. You can do this by creating a
connection (similar to how it's done inside `initLegacySchema()`), which then
allows to run a SQL.
--
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]