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


##########
be/src/format_v2/table_reader.cpp:
##########
@@ -486,8 +576,20 @@ Status TableReader::annotate_projected_column(const 
TFileScanSlotInfo& slot_info
         return Status::OK();
     }
     context->schema_column = 
build_schema_column_from_external_field(*schema_field, column->type);
+    const bool use_current_semantics = 
supports_iceberg_scan_semantics_v1(context->scan_params);
+    if (!use_current_semantics) {
+        // IDs and encoded defaults predate the result-changing semantics. 
Strip only the new
+        // default channel so an old-FE plan keeps the same generic 
root/nested values on every BE.
+        clear_initial_default_metadata(&*context->schema_column);
+    }
     column->identifier = context->schema_column->identifier;
     column->name_mapping = context->schema_column->name_mapping;
+    column->has_name_mapping = context->schema_column->has_name_mapping;

Review Comment:
   [P1] Prefer exact current names before mapping aliases
   
   A legal evolution can rename b#1 to renamed_b and then add a new b#2; a 
partial mapping may retain alias b only for #1 while #2 has an authoritative 
empty alias list. Because find_external_root_field() accepts either a current 
name or alias in one ordered pass, projecting current b can select #1 before 
reaching #2, and this assignment copies #1's ID/default metadata onto the 
projected field. ID-bearing and ID-less files can then return old field data 
instead of #2's initial default or NULL. Please search all siblings for an 
exact current name before trying aliases; find_schema_child_by_path() has the 
same ordering issue, so cover both shapes with V2 result tests.



##########
be/src/format/table/iceberg_reader.cpp:
##########
@@ -149,7 +150,7 @@ Status 
IcebergParquetReader::on_before_init_reader(ReaderInitContext* ctx) {
     } else {
         
RETURN_IF_ERROR(BuildTableInfoUtil::by_parquet_field_id_with_name_mapping(
                 get_scan_params().history_schema_info.front().root_field, 
*field_desc,
-                ctx->table_info_node));
+                ctx->table_info_node, 
supports_iceberg_scan_semantics_v1(&get_scan_params())));

Review Comment:
   [P1] Use the same file-wide ID mode for hidden delete keys
   
   This call now makes ordinary mapping use field IDs when any field in the 
data file has an Iceberg ID, but hidden equality-key expansion still requires 
every field to have an ID before looking up the key by ID. For a mixed-ID file 
containing old_key#1 plus an unrelated ID-less sibling, after #1 is renamed to 
new_key, an unprojected equality-delete file can still call the key old_key. 
The StructNode is keyed by current name new_key, so the hidden path misses the 
physical #1 column, synthesizes NULL/default, and fails to delete matching 
rows. Please use the same any-ID decision under semantics v1 for hidden Parquet 
and ORC keys, retain the legacy rule for absent-version plans, and add renamed 
hidden-key result coverage.



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