morningman commented on code in PR #13515:
URL: https://github.com/apache/doris/pull/13515#discussion_r1001294789
##########
be/src/vec/exec/format/csv/csv_reader.cpp:
##########
@@ -134,10 +150,19 @@ Status CsvReader::get_next_block(Block* block, size_t*
read_rows, bool* eof) {
return Status::OK();
}
- const int batch_size = _state->batch_size();
- auto columns = block->mutate_columns();
+ if (!_init_column_pos) {
+ // Save mapping from file slot desc to column in block, so that we
don't need to
+ // find column in block by name every time.
+ for (int i = 0; i < _file_slot_descs.size(); ++i) {
+ size_t position =
block->get_position_by_name(_file_slot_descs[i]->col_name());
+ _col_posistions.push_back(position);
+ }
+ _init_column_pos = true;
+ }
Review Comment:
removed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]