fallintoplace commented on code in PR #1134:
URL: https://github.com/apache/arrow-go/pull/1134#discussion_r3752616792


##########
arrow/compare.go:
##########
@@ -74,16 +74,20 @@ func TypeEqual(left, right DataType, opts 
...TypeEqualOption) bool {
                }
                return l.n == right.(*FixedSizeListType).n && l.elem.Nullable 
== right.(*FixedSizeListType).elem.Nullable
        case *MapType:
-               if !TypeEqual(l.KeyType(), right.(*MapType).KeyType(), opts...) 
{
+               r := right.(*MapType)
+               if !TypeEqual(l.KeyType(), r.KeyType(), opts...) {
                        return false
                }
-               if !TypeEqual(l.ItemType(), right.(*MapType).ItemType(), 
opts...) {
+               if !TypeEqual(l.ItemType(), r.ItemType(), opts...) {
                        return false
                }
-               if l.KeyField().Nullable != 
right.(*MapType).KeyField().Nullable {
+               if l.KeysSorted != r.KeysSorted {

Review Comment:
   Yep, I checked Arrow C++. It explicitly returns false when the two map types 
have different keys_sorted values. The map fingerprint encodes it as well, so 
this keeps Go aligned with C++: 
[C](https://github.com/apache/arrow/blob/42694575d0219f6a3a78b1f344bb071a60df6a4e/cpp/src/arrow/compare.cc#L836-L841)



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

Reply via email to