findepi commented on code in PR #10498:
URL: https://github.com/apache/iceberg/pull/10498#discussion_r1641426650


##########
core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java:
##########
@@ -466,6 +466,16 @@ public List<Namespace> listNamespaces(Namespace namespace) 
throws NoSuchNamespac
                         Arrays.stream(n.levels())
                             .limit(subNamespaceLevelLength)
                             .toArray(String[]::new)))
+            // exclude fuzzy matches

Review Comment:
   ```suggestion
               // exclude fuzzy matches when `namespace` contains `%` or `_`
   ```



##########
core/src/test/java/org/apache/iceberg/jdbc/TestJdbcCatalog.java:
##########
@@ -753,8 +753,9 @@ public void testListNamespace() {
     TableIdentifier tbl4 = TableIdentifier.of("db", "metadata");
     TableIdentifier tbl5 = TableIdentifier.of("db2", "metadata");
     TableIdentifier tbl6 = TableIdentifier.of("tbl6");
+    TableIdentifier tbl7 = TableIdentifier.of("db2", "ns4", "tbl5");

Review Comment:
   How does this test change exercise the problem?
   this new additional doesn't include `_` nor `%`



##########
core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java:
##########
@@ -466,6 +466,16 @@ public List<Namespace> listNamespaces(Namespace namespace) 
throws NoSuchNamespac
                         Arrays.stream(n.levels())
                             .limit(subNamespaceLevelLength)
                             .toArray(String[]::new)))
+            // exclude fuzzy matches
+            .filter(
+                n -> {
+                  for (int i = 0; i < namespace.levels().length; i++) {
+                    if (!n.levels()[i].equals(namespace.levels()[i])) {

Review Comment:
   this may be more expensive that deduplication, so let's put this filter 
after the distinct. 



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