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

[GitHub] [arrow-adbc] lidavidm commented on a diff in pull request #854: fix(go/adbc): fix crash on map type

lidavidm commented on code in PR #854:
URL: https://github.com/apache/arrow-adbc/pull/854#discussion_r1244193695


##########
go/adbc/utils/utils.go:
##########
@@ -30,7 +30,15 @@ func RemoveSchemaMetadata(schema *arrow.Schema) *arrow.Schema {
 func removeFieldMetadata(field *arrow.Field) arrow.Field {
 	fieldType := field.Type
 
-	if nestedType, ok := field.Type.(arrow.NestedType); ok {
+	if ty, ok := field.Type.(*arrow.MapType); ok {
+		// XXX: this can't handle nonstandard field names or

Review Comment:
   the original code thought a map directly had two children, instead we have to unpack it as it's actually a list[struct[



##########
go/adbc/utils/utils.go:
##########
@@ -30,7 +30,15 @@ func RemoveSchemaMetadata(schema *arrow.Schema) *arrow.Schema {
 func removeFieldMetadata(field *arrow.Field) arrow.Field {
 	fieldType := field.Type
 
-	if nestedType, ok := field.Type.(arrow.NestedType); ok {
+	if ty, ok := field.Type.(*arrow.MapType); ok {
+		// XXX: this can't handle nonstandard field names or

Review Comment:
   the original code thought a map directly had two children, instead we have to unpack it as it's actually a list[struct]



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