zeroshade commented on code in PR #808:
URL: https://github.com/apache/arrow-go/pull/808#discussion_r3228015107
##########
arrow/avro/schema.go:
##########
@@ -139,13 +139,16 @@ func arrowSchemafromAvro(n *schemaNode) {
arrowSchemafromAvro(c)
n.arrowField = buildArrowField(n,
arrow.MapOf(arrow.BinaryTypes.String, c.arrowField.Type), c.arrowField.Metadata)
case "union":
- if n.schema.(*avro.UnionSchema).Nullable() {
- if len(n.schema.(*avro.UnionSchema).Types()) > 1 {
- n.schema =
n.schema.(*avro.UnionSchema).Types()[1]
+ us := n.schema.(*avro.UnionSchema)
+ if us.Nullable() {
+ if len(us.Types()) > 1 {
+ n.schema = us.Types()[1]
n.union = true
n.nullable = true
arrowSchemafromAvro(n)
}
+ } else {
+ panic(fmt.Errorf("complex (non-nullable) avro union at
'%v' is not supported", n.schemaPath()))
Review Comment:
Should we add support and use the arrow union type? We could also do this as
a follow up instead.
--
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]