pvary commented on code in PR #17598:
URL: https://github.com/apache/iceberg/pull/17598#discussion_r4044895726


##########
core/src/main/java/org/apache/iceberg/rest/ETagProvider.java:
##########
@@ -45,6 +45,10 @@ public static String of(String metadataLocation, Map<String, 
String> params) {
       stringToHash = COMMA.join(metadataLocation, 
PARAMS_JOINER.join(orderedParams));
     }
 
-    return MURMUR3.hashString(stringToHash, StandardCharsets.UTF_8).toString();
+    return quote(MURMUR3.hashString(stringToHash, 
StandardCharsets.UTF_8).toString());
+  }
+
+  private static String quote(String string) {
+    return String.format("\"%s\"", string);
   }

Review Comment:
   This is just nitpicking, but `format` typically should choose a Locale, but 
that hides what we are doing even more. What about?
   
   ```suggestion
     private static String quote(String string) {
       return '"' + string + '"';
     }
   ```
   
   Maybe even rename to `asOpaqueTag` so the code describes a bit what we are 
doing.
   
   ```suggestion
     private static String asOpaqueTag(String hash) {
       return '"' + hash + '"';
     }
   ```
   
   I leave it to you



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

Reply via email to