You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "zeroshade (via GitHub)" <gi...@apache.org> on 2023/04/04 18:52:20 UTC

[GitHub] [arrow] zeroshade commented on a diff in pull request #34631: GH-34330: [Go][Parquet]: Add Extension type support

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: github-unsubscribe@arrow.apache.org

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