disq commented on code in PR #34631:
URL: https://github.com/apache/arrow/pull/34631#discussion_r1158368811
##########
go/internal/types/extension_types.go:
##########
@@ -209,13 +209,13 @@ func (UUIDType) ExtensionName() string { return "uuid" }
func (UUIDType) Serialize() string { return "uuid-serialized" }
// Deserialize expects storageType to be FixedSizeBinaryType{ByteWidth: 16}
and the data to be
-// "uuid-serialized" in order to correctly create a UuidType for testing
deserialize.
+// "uuid-serialized" in order to correctly create a UUIDType for testing
deserialize.
func (UUIDType) Deserialize(storageType arrow.DataType, data string)
(arrow.ExtensionType, error) {
if string(data) != "uuid-serialized" {
return nil, fmt.Errorf("type identifier did not match: '%s'",
string(data))
}
- if !arrow.TypeEqual(storageType, &arrow.FixedSizeBinaryType{ByteWidth:
16}) {
- return nil, fmt.Errorf("invalid storage type for UuidType: %s",
storageType.Name())
+ if !arrow.StorageTypeEqual(storageType,
&arrow.FixedSizeBinaryType{ByteWidth: 16}) {
+ return nil, fmt.Errorf("invalid storage type for UUIDType: %s",
storageType.Name())
Review Comment:
As I mentioned in the comment about the StorageEqual change, `storageType`
passed in here is apparently an `ExtensionType`, so `TypeEqual()` doesn't work
(as `FixedSizeBinaryType` isn't an extension type... which can be remedied by
creating an extension on top of that type, just for the sake of using
`TypeEqual()` though?). We could also unrolling the `storageEqual()` into here
as this is the only call site for that func, but I chose to leave it separate,
thinking it could be useful for other test types in the future.
##########
go/internal/types/extension_types.go:
##########
@@ -209,13 +209,13 @@ func (UUIDType) ExtensionName() string { return "uuid" }
func (UUIDType) Serialize() string { return "uuid-serialized" }
// Deserialize expects storageType to be FixedSizeBinaryType{ByteWidth: 16}
and the data to be
-// "uuid-serialized" in order to correctly create a UuidType for testing
deserialize.
+// "uuid-serialized" in order to correctly create a UUIDType for testing
deserialize.
func (UUIDType) Deserialize(storageType arrow.DataType, data string)
(arrow.ExtensionType, error) {
if string(data) != "uuid-serialized" {
return nil, fmt.Errorf("type identifier did not match: '%s'",
string(data))
}
- if !arrow.TypeEqual(storageType, &arrow.FixedSizeBinaryType{ByteWidth:
16}) {
- return nil, fmt.Errorf("invalid storage type for UuidType: %s",
storageType.Name())
+ if !arrow.StorageTypeEqual(storageType,
&arrow.FixedSizeBinaryType{ByteWidth: 16}) {
+ return nil, fmt.Errorf("invalid storage type for UUIDType: %s",
storageType.Name())
Review Comment:
As I mentioned in the comment about the StorageEqual change, `storageType`
passed in here is apparently an `ExtensionType`, so `TypeEqual()` doesn't work
(as `FixedSizeBinaryType` isn't an extension type... which can be remedied by
creating an extension on top of that type, just for the sake of using
`TypeEqual()` though?). We could also unroll the `storageEqual()` into here as
this is the only call site for that func, but I chose to leave it separate,
thinking it could be useful for other test types in the future.
--
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]