Skip to content
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

[BugFix] fix element_memory_usage of ArrayColumn (backport #17151) #17154

Merged
merged 1 commit into from
Feb 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion be/src/column/array_column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,9 @@ bool ArrayColumn::set_null(size_t idx) {

size_t ArrayColumn::element_memory_usage(size_t from, size_t size) const {
DCHECK_LE(from + size, this->size()) << "Range error";
return _elements->element_memory_usage(_offsets->get_data()[from], _offsets->get_data()[from + size]) +
size_t start_offset = _offsets->get_data()[from];
size_t elements_num = _offsets->get_data()[from + size] - start_offset;
return _elements->element_memory_usage(start_offset, elements_num) +
_offsets->Column::element_memory_usage(from, size);
}

Expand Down