-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What's the best way to measure the size of arrow.Record in Golang? #38836
Comments
My recommendation would be a variation on the first one: 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 |
Thanks, opened #38839 |
zeroshade
added a commit
that referenced
this issue
Nov 28, 2023
### Rationale for this change Address #38836 ### What changes are included in this PR? Add a new function SizeInBytes() to calculate the size of ArrayData. ### Are these changes tested? ### Are there any user-facing changes? No * Closes: #38836 Lead-authored-by: Yifeng Wu <yifeng@sigmacomputing.com> Co-authored-by: Matt Topol <zotthewizard@gmail.com> Co-authored-by: Yifeng-Sigma <yifeng@sigmacomputing.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
dgreiss
pushed a commit
to dgreiss/arrow
that referenced
this issue
Feb 19, 2024
### Rationale for this change Address apache#38836 ### What changes are included in this PR? Add a new function SizeInBytes() to calculate the size of ArrayData. ### Are these changes tested? ### Are there any user-facing changes? No * Closes: apache#38836 Lead-authored-by: Yifeng Wu <yifeng@sigmacomputing.com> Co-authored-by: Matt Topol <zotthewizard@gmail.com> Co-authored-by: Yifeng-Sigma <yifeng@sigmacomputing.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
kou
pushed a commit
to apache/arrow-go
that referenced
this issue
Aug 30, 2024
### Rationale for this change Address apache/arrow#38836 ### What changes are included in this PR? Add a new function SizeInBytes() to calculate the size of ArrayData. ### Are these changes tested? ### Are there any user-facing changes? No * Closes: #38836 Lead-authored-by: Yifeng Wu <yifeng@sigmacomputing.com> Co-authored-by: Matt Topol <zotthewizard@gmail.com> Co-authored-by: Yifeng-Sigma <yifeng@sigmacomputing.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the usage question you have. Please include as many useful details as possible.
I want to do some record splitting/merging based on the size, but didn't find a reliable way to estimate the size.
There are two ways:
or
I'm wondering what's the recommended way to compute the size of
arrow.Record
.Component(s)
Go
The text was updated successfully, but these errors were encountered: