cambyzju commented on code in PR #15665: URL: https://github.com/apache/doris/pull/15665#discussion_r1065292496
########## be/src/olap/rowset/segment_v2/column_reader.cpp: ########## @@ -49,6 +50,23 @@ Status ColumnReader::create(const ColumnReaderOptions& opts, const ColumnMetaPB& } else { auto type = (FieldType)meta.type(); switch (type) { + case FieldType::OLAP_FIELD_TYPE_STRUCT: { + // not support empty struct + DCHECK(meta.children_columns_size() >= 1); + // create struct column reader + std::unique_ptr<ColumnReader> struct_reader( + new ColumnReader(opts, meta, num_rows, file_reader)); + struct_reader->_sub_readers.resize(meta.children_columns_size()); + for (size_t i = 0; i < meta.children_columns_size(); i++) { + std::unique_ptr<ColumnReader> sub_reader; + RETURN_IF_ERROR(ColumnReader::create(opts, meta.children_columns(i), Review Comment: for loop may return early, it is better not use resize, use reserve instead. -- 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