zeroshade commented on code in PR #38839:
URL: https://github.com/apache/arrow/pull/38839#discussion_r1406555501
##########
go/arrow/array/data.go:
##########
@@ -190,9 +190,32 @@ func (d *Data) SetDictionary(dict arrow.ArrayData) {
}
}
+// Returns the size of Data in bytes
+func (d *Data) SizeInBytes() uint64 {
+ var size uint64
+
+ if d == nil {
+ return 0
+ }
+
+ for _, b := range d.Buffers() {
+ size += uint64(b.Len())
+ }
Review Comment:
It could potentially be very different depending on the difference between
the offset and the size. If the offset makes it so the arrow array is only of
size 1 (i.e. a slice of 1 from a very large array) then you could have a
significant difference in the calculation
--
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]