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


##########
be/src/format_v2/table_reader.cpp:
##########
@@ -298,12 +388,21 @@ const schema::external::TField* 
find_external_root_field(const TFileScanRangePar
     if (!schema->__isset.root_field || !schema->root_field.__isset.fields) {
         return nullptr;
     }
+    // A reused name identifies the newly added field, not an older sibling 
that retained that
+    // spelling as an alias. Exhaust exact current names before consulting 
historical aliases.
     for (const auto& field_ptr : schema->root_field.fields) {
         const auto* field = get_field_ptr(field_ptr);
-        if (field == nullptr) {
-            continue;
+        if (field != nullptr && field->__isset.name &&
+            to_lower(field->name) == to_lower(column.name)) {

Review Comment:
   [P1] Gate exact-name precedence for old-FE plans
   
   This exact-first pass changes field selection before 
`iceberg_scan_semantics_version` is checked. An old FE can send `renamed_b#1` 
with alias `b` before a newly added current `b#2`, while omitting fields 9 and 
34. For an all-ID file containing distinct values for both fields, the old BE's 
ordered lookup binds projected `b` to #1, but this new BE binds it to #2; the 
later capability check only clears defaults and cannot restore the identifier, 
so a BE-first rolling upgrade can return different values for one distributed 
scan. Please gate both the root and nested exact-first lookup on compatible-FE 
semantics, retain the former ordered lookup when the marker is absent, and 
cover the old-FE descriptor with both IDs present.



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