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/11/21 21:37:23 UTC

Re: [I] What's the best way to measure the size of arrow.Record in Golang? [arrow]

zeroshade commented on issue #38836:
URL: https://github.com/apache/arrow/issues/38836#issuecomment-1821730163

   My recommendation would be a variation on the first one:
   
   ```go
   func calcSize(arr arrow.ArrayData) (sz uint64) {
       if arr == nil {
           return
       }
   
       for _, b := range arr.Buffers() {
           sz += uint64(b.Len())
       }
       for _, c := range arr.Children() {
           sz += calcSize(c)
       }
       sz += calcSize(arr.Dictionary())
       return
   }
   ```
   
   That would be my recommendation, it might be reasonable to add this as a utility into the arrow library directly via a PR


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