github-actions[bot] commented on code in PR #67906:
URL: https://github.com/apache/doris/pull/67906#discussion_r3999312245


##########
be/src/exec/rowid_fetcher.cpp:
##########
@@ -437,6 +439,28 @@ const std::string 
RowIdStorageReader::TopNLazyMaterializationSecondPhaseRowsRead
 const std::string 
RowIdStorageReader::TopNLazyMaterializationSecondPhaseSegmentsRead =
         "TopNLazyMaterializationSecondPhaseSegmentsRead";
 
+bool RowIdStorageReader::should_use_file_scanner_v2(const TQueryOptions& 
query_options,
+                                                    const 
TFileScanRangeParams& scan_params,
+                                                    const TFileRangeDesc& 
range) {
+    const auto format_type =
+            range.__isset.format_type ? range.format_type : 
scan_params.format_type;
+    // Phase two inherits the query options, including the Thrift presence 
bit. Reuse phase one's
+    // policy so disabling V2 (or an older payload omitting the option) also 
keeps row fetches on V1.
+    return FileScanLocalState::should_use_file_scanner_v2(query_options, 
false, scan_params) &&

Review Comment:
   [P1] Gate the category-dependent phase-two path for old FE payloads. Field 
38 is optional, so during a BE-first rolling upgrade an old FE can omit 
`column_name_to_category` while still sending `enable_file_scanner_v2=true`. 
This selector then enters V2; when a lazy Iceberg `_file`/`_pos` slot was 
absent from phase one, the rebuild has no category and marks it physical, so 
`TableColumnMapper` does not synthesize the metadata value. The existing 
same-version thread is fixed because a current FE supplies the map, but it does 
not cover this absent-field path. Require field-38 presence (an explicitly 
empty map remains meaningful for physical same-name columns) or equivalent 
capability negotiation, and add an old-FE/new-BE lazy-metadata test.



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