You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/06/29 14:06:22 UTC

[GitHub] [iceberg] findepi commented on a diff in pull request #5157: Prevent StructLikeWrapper#equals from throwing an exception

findepi commented on code in PR #5157:
URL: https://github.com/apache/iceberg/pull/5157#discussion_r909680581


##########
core/src/main/java/org/apache/iceberg/util/StructLikeWrapper.java:
##########
@@ -65,6 +67,10 @@ public boolean equals(Object other) {
 
     StructLikeWrapper that = (StructLikeWrapper) other;
 
+    if (!type.equals(that.type)) {

Review Comment:
   You can do this just before `return comparator.compare(this.struct, that`
   if all you want is to "Prevent equals from throwing an exception"
   
   however, making equals compare by type too looks like a good change as well.
   this, however, should be called out in the commit message.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org