RussellSpitzer commented on code in PR #4560:
URL: https://github.com/apache/iceberg/pull/4560#discussion_r856569560


##########
core/src/main/java/org/apache/iceberg/PartitionsTable.java:
##########
@@ -140,20 +195,13 @@ private class PartitionsScan extends StaticTableScan {
   }
 
   static class PartitionMap {
-    private final Map<StructLikeWrapper, Partition> partitions = 
Maps.newHashMap();
-    private final Types.StructType type;
-    private final StructLikeWrapper reused;
-
-    PartitionMap(Types.StructType type) {
-      this.type = type;
-      this.reused = StructLikeWrapper.forType(type);
-    }
+    private final Map<StructLike, Partition> partitions = Maps.newHashMap();
 
     Partition get(StructLike key) {
-      Partition partition = partitions.get(reused.set(key));
+      Partition partition = partitions.get(key);
       if (partition == null) {
         partition = new Partition(key);
-        partitions.put(StructLikeWrapper.forType(type).set(key), partition);

Review Comment:
   I'm a bit confused by this change, I believe the issue here is that 
StructType does not have a well defined hashFunction (since implementations can 
do whatever they like) which is why we use the Wrapper to make sure we have a 
valid hash.



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