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

[GitHub] [arrow] zeroshade commented on a diff in pull request #35899: GH-35909: [Go] Deprecate `arrow.MapType.ValueField` & `arrow.MapType.ValueType` methods

zeroshade commented on code in PR #35899:
URL: https://github.com/apache/arrow/pull/35899#discussion_r1219920936


##########
go/parquet/pqarrow/encode_arrow.go:
##########
@@ -36,19 +36,17 @@ import (
 
 // get the count of the number of leaf arrays for the type
 func calcLeafCount(dt arrow.DataType) int {
+	if dt, ok := dt.(arrow.ListLikeType); ok {
+		return calcLeafCount(dt.Elem())
+	}

Review Comment:
   could we further simply this by doing 
   
   ```go
   if dt, ok := dt.(arrow.NestedType); ok {
       nleaves := 0
       for _, f := range dt.Fields() {
           nleaves += calcLeafCount(f.Type)
       }
       return nleaves
   }
   ```
   Which will cover struct types in addition to the list/map types?



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