This is an automated email from the ASF dual-hosted git repository.
gabriellee pushed a commit to branch opt_perf
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/opt_perf by this push:
new 57b5ae0101 [Improvement](dict) optimize dictionary column (revert
previous one) (#12946)
57b5ae0101 is described below
commit 57b5ae01019ab2b45af38e6decfaad945ea1c54d
Author: Gabriel <[email protected]>
AuthorDate: Sat Sep 24 21:54:06 2022 +0800
[Improvement](dict) optimize dictionary column (revert previous one)
(#12946)
* Revert "[Improvement](dict) optimize dictionary column (#12880)"
This reverts commit eb68ee6560b94a6844f4605398f997f878646936.
* [Improvement](dict) optimize dictionary column
---
be/src/vec/columns/column_dictionary.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/be/src/vec/columns/column_dictionary.h
b/be/src/vec/columns/column_dictionary.h
index 93fbcb9a3e..2c09d4fb7c 100644
--- a/be/src/vec/columns/column_dictionary.h
+++ b/be/src/vec/columns/column_dictionary.h
@@ -375,6 +375,7 @@ public:
void clear() {
_dict_data->clear();
+ _code_convert_table.clear();
_hash_values.clear();
}
@@ -383,6 +384,7 @@ public:
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;
@@ -413,7 +415,7 @@ public:
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();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]