patricklucas commented on issue #11990:
URL: https://github.com/apache/iceberg/issues/11990#issuecomment-3004231324

   I also ran into this. I created a namespace like `Namespace.of("foo", 
"bar.baz")` expecting that the namespace "levels" would be treated opaquely 
like with other catalogs. However, after a round trip to the `iceberg_tables` 
table, this namespace is now interpreted as `Namespace.of("foo", "bar", "baz")`.
   
   In the `RESTCatalog`, for instance, when namespace are included in URLs, 
each level gets URL-encoded and then the levels are joined by `%2f` (i.e. `/`), 
so dots would be preserved. That said, I'm not sure what the behavior is if if 
a namespace level includes a slash.
   
   Nevertheless, Iceberg should take a clear stance on namespace handling that 
is consistent across catalog implementations. The most explicit approach would 
be to say that namespace levels may contain any Unicode character, and then 
catalog implementations always act accordingly, encoding and decoding as 
necessary. This would require each implementation to choose how to represent 
them, and "double encoding" might be required, for instance to solve the 
potential slashes issue in `RESTCatalog`.
   
   Example: encoding namespace `Namespace.of("foo/bar", "baz")` for inclusion 
in a URL, becomes `foo%252Fbar%2Fbaz`:
   
   ```
   In [1]: import urllib
   
   In [2]: level1 = urllib.parse.quote_plus('foo/bar')
   
   In [3]: level1
   Out[3]: 'foo%2Fbar'
   
   In [4]: level2 = urllib.parse.quote_plus('baz')
   
   In [5]: level2
   Out[5]: 'baz'
   
   In [6]: encoded = urllib.parse.quote_plus(level1 + '/' + level2)
   
   In [7]: encoded
   Out[7]: 'foo%252Fbar%2Fbaz'
   
   In [8]: [urllib.parse.unquote(level) for level in 
urllib.parse.unquote(encoded).split('/')]
   Out[8]: ['foo/bar', 'baz']
   ```


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