zeroshade commented on code in PR #1439:
URL: https://github.com/apache/iceberg-go/pull/1439#discussion_r3566791569
##########
catalog/sql/sql.go:
##########
@@ -1009,9 +1042,15 @@ func (c *Catalog) ListNamespaces(ctx context.Context,
parent table.Identifier) (
return nil, err
}
- ret := make([]table.Identifier, len(namespaces))
- for i, n := range namespaces {
- ret[i] = strings.Split(n, ".")
+ ret := make([]table.Identifier, 0, len(namespaces))
+ for _, n := range namespaces {
+ ident, err := namespaceFromString(n)
+ if err != nil {
+ return nil, err
+ }
+ if len(parent) == 0 || (len(ident) >= len(parent) &&
slices.Equal(ident[:len(parent)], parent)) {
Review Comment:
Non-blocking: `ListNamespaces` now drops the SQL `LIKE 'parent%'` narrowing
and instead fetches every namespace for the catalog and filters by parent in
Go. That's understandable given the new encoding (a JSON-encoded value won't
match a dot-prefix LIKE), but for catalogs with many namespaces it becomes a
fetch-all + client-side scan. If that turns into a hotspot, an encoded/indexed
prefix column or a bounded query could restore server-side filtering.
--
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]