-
Notifications
You must be signed in to change notification settings - Fork 155
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
feat(execute): allocate memory for string content. #5482
Conversation
Update the string column builder to account for the memory for the string contents.
@@ -1180,7 +1202,9 @@ func (b *ColListTableBuilder) GetRow(row int) values.Object { | |||
case flux.TFloat: | |||
val = values.NewFloat(b.cols[j].(*floatColumnBuilder).data[row]) | |||
case flux.TString: | |||
val = values.NewString(b.cols[j].(*stringColumnBuilder).data[row]) | |||
// TODO(mhilton): avoid a copy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is intended this will be changed in a followup PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that this PR prepares the way to determine if a column has particularly long strings. Looks good to me! ✅
// String represents a string stored in some backing byte slice. | ||
type String struct { | ||
offset int | ||
len int | ||
} | ||
|
||
func (s String) Bytes(buf *arrowmem.Buffer) []byte { | ||
return buf.Bytes()[s.offset : s.offset+s.len] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 My understanding of this new struct is that it stores the column string size and if a string get too long, we can do something with it
Update the string column builder to account for the memory for the string contents. This is part of an effort to reduce the prevelence of OOMs caused by unaccounted memory data See influxdata/idpe#18697.
Checklist
Dear Author 👋, the following checks should be completed (or explicitly dismissed) before merging.
experimental/
docs/Spec.md
has been updatedDear Reviewer(s) 👋, you are responsible (among others) for ensuring the completeness and quality of the above before approval.