nssalian commented on a change in pull request #3275:
URL: https://github.com/apache/iceberg/pull/3275#discussion_r741605665



##########
File path: core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java
##########
@@ -116,6 +119,19 @@ private void initializeCatalogTables() throws 
InterruptedException, SQLException
       LOG.debug("Creating table {} to store iceberg catalog", 
JdbcUtil.CATALOG_TABLE_NAME);
       return conn.prepareStatement(JdbcUtil.CREATE_CATALOG_TABLE).execute();
     });
+
+    connections.run(conn -> {
+      DatabaseMetaData dbMeta = conn.getMetaData();
+      ResultSet tableExists = dbMeta.getTables(null, null, 
JdbcUtil.CREATE_NAMESPACE_PROPERTIES_TABLE, null);
+
+      if (tableExists.next()) {
+        return true;

Review comment:
       Yeah, I think the naming can't be be better. Tried to keep it simple and 
effective.
   
   Not sure I follow the `getTables` question. It's checking if there exists a 
row in the Tables table where this namespace exists. 
   ```
   protected static final String GET_NAMESPACE_SQL = "SELECT " + 
TABLE_NAMESPACE + " FROM " + CATALOG_TABLE_NAME +
         " WHERE " + CATALOG_NAME + " = ? AND " + TABLE_NAMESPACE + " LIKE ? 
LIMIT 1";
   ```
   not sure what you mean about the CREATE TABLE DDL being used? Could you 
clarify?




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

Reply via email to