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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to