Skip to content
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/vec/columns/column_dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ class ColumnDictionary final : public COWHelper<IColumn, ColumnDictionary<T>> {

void clear() {
_dict_data->clear();
_code_convert_table.clear();
_hash_values.clear();
}

Expand All @@ -383,6 +384,7 @@ class ColumnDictionary final : public COWHelper<IColumn, ColumnDictionary<T>> {
void sort() {
size_t dict_size = _dict_data->size();

_code_convert_table.reserve(dict_size);
_perm.resize(dict_size);
for (size_t i = 0; i < dict_size; ++i) {
_perm[i] = i;
Expand Down Expand Up @@ -413,7 +415,7 @@ class ColumnDictionary final : public COWHelper<IColumn, ColumnDictionary<T>> {

bool empty() { return _dict_data->empty(); }

size_t avg_str_len() { return _total_str_len / _dict_data->size(); }
size_t avg_str_len() { return empty() ? 0 : _total_str_len / _dict_data->size(); }

private:
StringValue _null_value = StringValue();
Expand Down