You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/02/25 20:57:58 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #4231: Core: Clean up JDBC implementation, add catalog namespace tests

rdblue commented on a change in pull request #4231:
URL: https://github.com/apache/iceberg/pull/4231#discussion_r815150500



##########
File path: core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java
##########
@@ -446,190 +402,153 @@ public void close() {
 
   @Override
   public boolean namespaceExists(Namespace namespace) {
+    if (exists(JdbcUtil.GET_NAMESPACE_SQL, catalogName, JdbcUtil.namespaceToString(namespace) + "%")) {
+      return true;
+    }
+
+    if (exists(JdbcUtil.GET_NAMESPACE_PROPERTIES_SQL, catalogName, JdbcUtil.namespaceToString(namespace) + "%")) {
+      return true;
+    }
+
+    return false;
+  }
+
+  private int execute(String sql, String... args) {
+    return execute(err -> {}, sql, args);
+  }
+
+  private int execute(Consumer<SQLException> sqlErrorHandler, String sql, String... args) {

Review comment:
       This is used in one case: https://github.com/apache/iceberg/pull/4231/files#diff-a5f7966c7493d463facbf7e76fe0fa3db1b637d29ee12e5b3628a5e5dd289e0aR195
   
   I did this to avoid having a SQLException try/catch in every method.




-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org