singhpk234 commented on code in PR #7128:
URL: https://github.com/apache/iceberg/pull/7128#discussion_r1146971007


##########
core/src/main/java/org/apache/iceberg/LocationProviders.java:
##########
@@ -167,5 +169,17 @@ private static String pathContext(String tableLocation) {
 
       return resolvedContext;
     }
+
+    private static String computeHash(String fileName) {
+      Preconditions.checkState(fileName != null, "fileName cannot be null");
+      byte[] hashBuffer = new byte[6];

Review Comment:
   As per my understanding, this is required, since we generate 4 bytes hash, 
and to pass it to base64 encode we need size to be a multiple of 3 .. hence we 
create 6 size, byte array (as you suggested above), one possible option is to 
extract only 3 bytes from hash and do it without using extra memory (still 
thinking through). please let me take a deeper look, if it is suff and can be 
done without taking any extra memory !
   
   ---
   
   One observation, a long variable would also have taken 8 bytes and since 
this is also a local variable, thinking if it will add some memory pressure in 
some scenario.



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