dgvj-work commented on code in PR #1241:
URL: https://github.com/apache/arrow-go/pull/1241#discussion_r3910688151


##########
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:
   `legacyVariantType` now owns its own `String`/`ExtensionEquals`, and 
`Deserialize` always returns a canonical `VariantType`. `VariantArray` 
accessors go through `asVariantType` so a registry-built array no longer 
panics. Added tests for equality symmetry, the legacy string, IPC 
canonicalization, and direct legacy-array access.



-- 
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]

Reply via email to