HappenLee commented on code in PR #17594: URL: https://github.com/apache/doris/pull/17594#discussion_r1133407827
########## be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp: ########## @@ -434,13 +445,46 @@ class FixLengthDictDecoder<char*> final : public BaseDictDecoder { _dict = std::move(dict); char* dict_item_address = reinterpret_cast<char*>(_dict.get()); _dict_items.resize(num_values); + _dict_value_to_code.reserve(num_values); for (size_t i = 0; i < num_values; ++i) { _dict_items[i] = dict_item_address; + _dict_value_to_code[StringRef(_dict_items[i], _type_length)] = i; dict_item_address += _type_length; } return Status::OK(); } + Status read_dict_values_to_column(MutableColumnPtr& doris_column) override { + size_t dict_items_size = _dict_items.size(); + std::vector<StringRef> dict_values(dict_items_size); + for (size_t i = 0; i < dict_items_size; ++i) { + dict_values.emplace_back(_dict_items[i], _type_length); + } + doris_column->insert_many_strings(&dict_values[0], dict_items_size); + return Status::OK(); + } + + Status get_dict_codes(const ColumnString* string_column, + std::vector<int32_t>* dict_codes) override { + for (int i = 0; i < string_column->size(); ++i) { + StringRef dict_value = string_column->get_data_at(i); + dict_codes->emplace_back(_dict_value_to_code[dict_value]); Review Comment: check `dict_codes` reverse before call `get_dict_codes`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org