nastra commented on code in PR #10124:
URL: https://github.com/apache/iceberg/pull/10124#discussion_r1565239656
##########
core/src/test/java/org/apache/iceberg/jdbc/TestJdbcCatalog.java:
##########
@@ -1020,4 +1062,36 @@ private void initLegacySchema(String jdbcUrl) throws
SQLException {
.execute();
}
}
+
+ private boolean catalogTablesExist(String jdbcUrl) throws SQLException {
+ SQLiteDataSource dataSource = new SQLiteDataSource();
+ dataSource.setUrl(jdbcUrl);
+
+ boolean catalogTableExists = false;
+ boolean namespacePropertiesTableExists = false;
+
+ try (Connection connection = dataSource.getConnection()) {
+ DatabaseMetaData metadata = connection.getMetaData();
+ if (tableExists(metadata, JdbcUtil.CATALOG_TABLE_VIEW_NAME)) {
+ catalogTableExists = true;
+ }
+ if (tableExists(metadata, JdbcUtil.NAMESPACE_PROPERTIES_TABLE_NAME)) {
+ namespacePropertiesTableExists = true;
+ }
+ }
+
+ return catalogTableExists && namespacePropertiesTableExists;
+ }
+
+ boolean tableExists(DatabaseMetaData metadata, String tableName) throws
SQLException {
Review Comment:
can be private
--
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]