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


##########
core/src/main/java/org/apache/iceberg/jdbc/JdbcUtil.java:
##########
@@ -303,6 +287,325 @@ public static Properties 
filterAndRemovePrefix(Map<String, String> properties, S
     return result;
   }
 
+  static String getTableOrViewSql(boolean table) {
+    String tableOrViewTableName = table ? CATALOG_TABLE_NAME : 
CATALOG_VIEW_NAME;
+    String tableOrViewNamespace = table ? TABLE_NAMESPACE : VIEW_NAMESPACE;
+    String tableOrViewName = table ? TABLE_NAME : VIEW_NAME;
+    return String.format(
+        GET_TABLE_OR_VIEW_SQL, tableOrViewTableName, tableOrViewNamespace, 
tableOrViewName);
+  }
+
+  private static String getTableOrViewNamespaceSql(boolean table) {
+    String tableOrViewTableName = table ? CATALOG_TABLE_NAME : 
CATALOG_VIEW_NAME;
+    String tableOrViewNamespace = table ? TABLE_NAMESPACE : VIEW_NAMESPACE;
+    return String.format(
+        GET_TABLE_OR_VIEW_NAMESPACE_SQL,
+        tableOrViewNamespace,
+        tableOrViewTableName,
+        tableOrViewNamespace,
+        tableOrViewNamespace);
+  }
+
+  public static String getTableNamespaceSql() {
+    return getTableOrViewNamespaceSql(true);
+  }
+
+  public static String getViewNamespaceSql() {
+    return getTableOrViewNamespaceSql(false);
+  }
+
+  private static String listTableOrViewNamespacesSql(boolean table) {
+    String tableOrViewTableName = table ? CATALOG_TABLE_NAME : 
CATALOG_VIEW_NAME;
+    String tableOrViewNamespace = table ? TABLE_NAMESPACE : VIEW_NAMESPACE;
+    return String.format(
+        LIST_TABLE_OR_VIEW_NAMESPACES_SQL,
+        tableOrViewNamespace,
+        tableOrViewTableName,
+        tableOrViewNamespace);
+  }
+
+  public static String listTableNamespacesSql() {
+    return listTableOrViewNamespacesSql(true);
+  }
+
+  public static String listViewNamespacesSql() {
+    return listTableOrViewNamespacesSql(false);
+  }
+
+  private static String listAllTableOrViewNamespacesSql(boolean table) {
+    String tableOrViewTableName = table ? CATALOG_TABLE_NAME : 
CATALOG_VIEW_NAME;
+    String tableOrViewNamespace = table ? TABLE_NAMESPACE : VIEW_NAMESPACE;
+    return String.format(
+        LIST_ALL_TABLE_OR_VIEW_NAMESPACES_SQL, tableOrViewNamespace, 
tableOrViewTableName);
+  }
+
+  public static String listAllTableNamespacesSql() {
+    return listAllTableOrViewNamespacesSql(true);
+  }
+
+  public static String listAllViewNamespacesSql() {
+    return listAllTableOrViewNamespacesSql(false);
+  }
+
+  static String doCommitSql(boolean table) {

Review Comment:
   ```suggestion
     private static String doCommitSql(boolean table) {
   ```



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