Describe the bug
When reading the implementation of StringViewArrayBuilder::with_capacity at datafusion/functions/src/strings.rs:136:
pub fn with_capacity(_item_capacity: usize, data_capacity: usize) -> Self {
let builder = StringViewBuilder::with_capacity(data_capacity);
Self {
builder,
block: String::new(),
}
}
I could be mistaken, but I think that item_capacity should be passed to the inner with_capacity call rather than data_capacity. The StringViewBuilder::with_capacity call reserves space for the string offsets, which is proportional to the number of strings, not the total number of bytes used by those strings.
Obviously this is just a performance bug, not a correctness issue.
To Reproduce
No response
Expected behavior
No response
Additional context
No response
Describe the bug
When reading the implementation of
StringViewArrayBuilder::with_capacityatdatafusion/functions/src/strings.rs:136:I could be mistaken, but I think that
item_capacityshould be passed to the innerwith_capacitycall rather thandata_capacity. TheStringViewBuilder::with_capacitycall reserves space for the string offsets, which is proportional to the number of strings, not the total number of bytes used by those strings.Obviously this is just a performance bug, not a correctness issue.
To Reproduce
No response
Expected behavior
No response
Additional context
No response