zeroshade commented on code in PR #1241:
URL: https://github.com/apache/arrow-go/pull/1241#discussion_r3908966629
##########
arrow/extensions/extensions.go:
##########
@@ -35,4 +35,20 @@ func init() {
panic(err)
}
}
+
+ // arrow-go originally registered Variant as parquet.variant. Keep that
+ // name in the registry so older IPC still deserializes. Seed default
+ // storage so GetExtensionType("parquet.variant") is a complete type.
+ if err := arrow.RegisterExtensionType(&legacyVariantType{VariantType:
*NewDefaultVariantType()}); err != nil {
+ panic(err)
+ }
}
+
+// legacyVariantType exists only so GetExtensionType("parquet.variant") can
+// still reconstruct a VariantType. In-memory and newly written IPC use
+// VariantExtensionName.
+type legacyVariantType struct {
+ VariantType
Review Comment:
Embedding `VariantType` promotes canonical `String`/`ExtensionEquals`
behavior, making legacy equality asymmetric; arrays built from the registry
prototype can also panic because `VariantArray` asserts `*VariantType`. Please
treat this as a compatibility adapter: override legacy identity/equality,
explicitly deserialize old IPC to canonical `VariantType`, and normalize
legacy/canonical types through one helper in `VariantArray` accessors. Add
symmetry, legacy-string, IPC-canonicalization, and direct legacy-array tests.
--
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]