zeroshade commented on code in PR #34631:
URL: https://github.com/apache/arrow/pull/34631#discussion_r1157643287
##########
go/arrow/compare.go:
##########
@@ -129,3 +129,15 @@ func TypeEqual(left, right DataType, opts
...TypeEqualOption) bool {
return reflect.DeepEqual(left, right)
}
}
+
+// StorageTypeEqual checks if the underlying storage of two DataType are the
same,
+// optionally checking metadata equality for STRUCT types by passing to
TypeEqual
+func StorageTypeEqual(left, right DataType, opts ...TypeEqualOption) bool {
+ if leftExt, ok := left.(ExtensionType); ok {
+ left = leftExt.StorageType()
+ }
+ if rightExt, ok := right.(ExtensionType); ok {
+ right = rightExt.StorageType()
+ }
+ return TypeEqual(left, right, opts...)
+}
Review Comment:
might make sense to simply implement this as the default implementation of
`ExtensionEquals` in `ExtensionBase` that other extension types can implement
or otherwise. Honestly I don't see much benefit to having this function over
letting consumers just call `TypeEqual` themselves and having the extension
types implement `ExtensionEquals` appropriately.
--
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]