yiguolei commented on code in PR #49040:
URL: https://github.com/apache/doris/pull/49040#discussion_r2306095810


##########
be/src/olap/rowset/segment_v2/segment.cpp:
##########
@@ -589,15 +579,19 @@ vectorized::DataTypePtr Segment::get_data_type_of(const 
TabletColumn& column,
     int32_t unique_id = column.unique_id() > 0 ? column.unique_id() : 
column.parent_unique_id();
 
     // Find the reader for the base variant column.
-    if (!_column_readers.contains(unique_id)) {
+    if (!_column_uid_to_footer_ordinal.contains(unique_id)) {
         return 
vectorized::DataTypeFactory::instance().create_data_type(column);
     }
 
-    const auto* variant_reader =
-            static_cast<const 
VariantColumnReader*>(_column_readers.at(unique_id).get());
+    std::shared_ptr<ColumnReader> reader;
+    // get the parent variant column reader
+    OlapReaderStatistics stats;
+    // If status is not ok, it will throw exception(data corruption)
+    THROW_IF_ERROR(get_column_reader(unique_id, &reader, &stats));
+    const auto* variant_reader = static_cast<const 
VariantColumnReader*>(reader.get());

Review Comment:
   这里,假如status 是ok的话,reader 也可能是nullptr的,591 行里面的一些调用不会挂掉吗?



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

Reply via email to