morningman commented on code in PR #17988:
URL: https://github.com/apache/doris/pull/17988#discussion_r1144120852


##########
be/src/vec/exec/format/parquet/vparquet_group_reader.cpp:
##########
@@ -290,27 +292,28 @@ Status RowGroupReader::_read_column_data(Block* block, 
const std::vector<std::st
                                          ColumnSelectVector& select_vector) {
     size_t batch_read_rows = 0;
     bool has_eof = false;
-    for (auto& read_col : columns) {
-        auto& column_with_type_and_name = block->get_by_name(read_col);
+    for (auto& read_col_name : columns) {
+        auto& column_with_type_and_name = block->get_by_name(read_col_name);
         auto& column_ptr = column_with_type_and_name.column;
         auto& column_type = column_with_type_and_name.type;
-        auto col_iter =
-                std::find(_dict_filter_col_names.begin(), 
_dict_filter_col_names.end(), read_col);
         bool is_dict_filter = false;
-        if (col_iter != _dict_filter_col_names.end()) {
-            MutableColumnPtr dict_column = ColumnVector<Int32>::create();
-            size_t pos = block->get_position_by_name(read_col);
-            if (column_type->is_nullable()) {
-                block->get_by_position(pos).type =
-                        
std::make_shared<DataTypeNullable>(std::make_shared<DataTypeInt32>());
-                block->replace_by_position(
-                        pos, ColumnNullable::create(std::move(dict_column),
-                                                    
ColumnUInt8::create(dict_column->size(), 0)));
-            } else {
-                block->get_by_position(pos).type = 
std::make_shared<DataTypeInt32>();
-                block->replace_by_position(pos, std::move(dict_column));
+        for (auto& _dict_filter_col : _dict_filter_cols) {
+            if (_dict_filter_col.first == read_col_name) {
+                MutableColumnPtr dict_column = ColumnVector<Int32>::create();
+                size_t pos = block->get_position_by_name(read_col_name);
+                if (column_type->is_nullable()) {
+                    block->get_by_position(pos).type =
+                            
std::make_shared<DataTypeNullable>(std::make_shared<DataTypeInt32>());
+                    block->replace_by_position(
+                            pos,
+                            ColumnNullable::create(std::move(dict_column),
+                                                   
ColumnUInt8::create(dict_column->size(), 0)));
+                } else {
+                    block->get_by_position(pos).type = 
std::make_shared<DataTypeInt32>();
+                    block->replace_by_position(pos, std::move(dict_column));
+                }
+                is_dict_filter = true;

Review Comment:
   Missing break.
   And please add some comment to explain why using id, not name



-- 
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

Reply via email to