snazy commented on code in PR #10877:
URL: https://github.com/apache/iceberg/pull/10877#discussion_r1714877056
##########
core/src/main/java/org/apache/iceberg/rest/RESTUtil.java:
##########
@@ -194,15 +192,34 @@ public static String decodeString(String encoded) {
* @return UTF-8 encoded string representing the namespace, suitable for use
as a URL parameter
*/
public static String encodeNamespace(Namespace ns) {
- Preconditions.checkArgument(ns != null, "Invalid namespace: null");
- String[] levels = ns.levels();
+ return encodeNamespace(ns, NAMESPACE_ESCAPED_SEPARATOR);
+ }
+
+ /**
+ * Returns a String representation of a namespace that is suitable for use
in a URL / URI.
+ *
+ * <p>This function needs to be called when a namespace is used as a path
variable (or query
+ * parameter etc.), to format the namespace per the spec.
+ *
+ * <p>{@link RESTUtil#decodeNamespace(String, String)} should be used to
parse the namespace from
+ * a URL parameter.
+ *
+ * @param namespace namespace to encode
+ * @param separator The namespace separator to use for encoding
+ * @return UTF-8 encoded string representing the namespace, suitable for use
as a URL parameter
Review Comment:
The purpose of this change is to tackle those "problematic characters", so I
think the justification to just resolve this concern with "this is just
copy-pasted javadoc from the overloaded method" isn't 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]