amogh-jahagirdar commented on code in PR #10877:
URL: https://github.com/apache/iceberg/pull/10877#discussion_r1704687240
##########
core/src/main/java/org/apache/iceberg/rest/RESTUtil.java:
##########
@@ -215,8 +232,26 @@ public static String encodeNamespace(Namespace ns) {
* @return a namespace
*/
public static Namespace decodeNamespace(String encodedNs) {
+ return decodeNamespace(encodedNs, NAMESPACE_ESCAPED_SEPARATOR);
+ }
+
+ /**
+ * Takes in a string representation of a namespace as used for a URL
parameter and returns the
+ * corresponding namespace.
+ *
+ * <p>See also {@link #encodeNamespace} for generating correctly formatted
URLs.
+ *
+ * @param encodedNs a namespace to decode
+ * @param namespaceSeparator The namespace separator to use for decoding.
This should be the same
+ * separator that was used when calling {@link
RESTUtil#encodeNamespace(Namespace, String)}
+ * @return a namespace
+ */
+ public static Namespace decodeNamespace(String encodedNs, String
namespaceSeparator) {
Review Comment:
Nit: (I know it was like this before) Could we rename the paramaters so it's
either consistently using the abbreviation or consistently using the full name
rather than one parameter using one or the other? Think I'd prefer the full
name `encodedNamespace` (and I don't think revAPI will complain about renaming
a parameter in the existing API?)
##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -116,6 +116,7 @@ public class RESTSessionCatalog extends
BaseViewSessionCatalog
private static final String DEFAULT_FILE_IO_IMPL =
"org.apache.iceberg.io.ResolvingFileIO";
private static final String REST_METRICS_REPORTING_ENABLED =
"rest-metrics-reporting-enabled";
private static final String REST_SNAPSHOT_LOADING_MODE =
"snapshot-loading-mode";
+ static final String REST_NAMESPACE_SEPARATOR = "rest-namespace-separator";
Review Comment:
Probably worth double checking if there's a good place to document this? I
don't think we have a dedicated client side catalog configuration document for
REST , maybe we can take that as a separate issue. But if there's anywhere else
to add this in the interim, that would be good.
--
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]