rdblue commented on code in PR #8340:
URL: https://github.com/apache/iceberg/pull/8340#discussion_r1367148848


##########
core/src/main/java/org/apache/iceberg/jdbc/JdbcUtil.java:
##########
@@ -345,19 +354,27 @@ public static String 
deletePropertiesStatement(Set<String> properties) {
 
   static boolean namespaceExists(
       String catalogName, JdbcClientPool connections, Namespace namespace) {
+
+    String namespaceEquals = JdbcUtil.namespaceToString(namespace);
+    // when namespace has sub-namespace then additionally checking it with 
LIKE statement.
+    // catalog.db can exists as: catalog.db.ns1 or catalog.db.ns1.ns2
+    String namespaceStartsWith =
+        namespaceEquals.replace("\\", "\\\\").replace("_", "\\_").replace("%", 
"\\%") + ".%";

Review Comment:
   Since this converts `\` into an escaped character, I think we also need test 
cases for namespaces with `\`.



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