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


##########
be/src/format_v2/table/iceberg_reader.cpp:
##########
@@ -1961,7 +2079,16 @@ Status 
IcebergTableReader::_append_equality_delete_predicates(format::FileScanRe
             } else {
                 const auto* root = data_path.front();
                 const auto field_column_id = 
format::LocalColumnId(root->file_local_id());
-                _append_file_scan_column(request, field_column_id, 
&request->predicate_columns);
+                // A hidden key has no ColumnMapping to carry the timestamp 
marker that
+                // annotate_file_schema() put on the file column. Without it 
Parquet decodes an
+                // INT96 timestamptz key as DATETIMEV2 while the key 
expression below, built from
+                // the annotated file schema, expects TIMESTAMPTZ. A projected 
key moves into the
+                // predicate columns here and must keep the marker its mapping 
carried.
+                auto projection = 
format::LocalColumnIndex::top_level(field_column_id);
+                
format::attach_timestamp_semantics(root->timestamp_is_adjusted_to_utc,
+                                                   root->children, 
&projection);

Review Comment:
   [P1] Preserve markers on missing-key ancestor projections
   
   Please apply the same timestamp override in 
`_build_missing_equality_delete_key_expr`, which still adds its physical 
ancestor through the markerless `_append_file_scan_column` at line 2040. For an 
older Parquet file containing nullable `payload {ts: INT96 timestamptz}`, a 
newer schema adding `payload.k INT DEFAULT 7`, and a nonempty equality delete 
on `k`, `SELECT id` reads `payload` to preserve ancestor NULLs. The new 
annotation makes its file-block type `STRUCT<TIMESTAMPTZ>`, but this request 
carries no descendant marker, so Parquet still builds `STRUCT<DATETIMEV2>` and 
`check_block_column_type` fails the query. Reuse the annotated projection for 
this incomplete-key branch too, and extend the missing-nested-key test with a 
timestamp sibling hidden from the SELECT.



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