disq commented on code in PR #34631:
URL: https://github.com/apache/arrow/pull/34631#discussion_r1158359808
##########
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:
This is different than `ExtensionEquals`, as that one compares the
underlying storage types and doesn't require both types to be extensions. In
our case one of the two inputs is `FixedSizeBinaryType` and the is `UUIDType`
which is an extension type. It's now only used in `UUIDType.deserialize()` so
I've unexported and moved it to `internal/types`.
--
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]