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


##########
be/src/format_v2/table_reader.h:
##########
@@ -461,6 +461,8 @@ class TableReader {
         RETURN_IF_ERROR(_data_reader.column_mapper->create_scan_request(
                 _table_filters, _projected_columns, file_request.get(), 
_runtime_state));
         file_request->row_ids = _row_ids;
+        file_request->allow_row_reordering =
+                std::ranges::all_of(_conjuncts, _is_safe_to_pre_execute);

Review Comment:
   [P2] Fence implicit projection conversions before reordering
   
   This flag checks only `_conjuncts`, while `TableReader::finalize_chunk` also 
executes file-to-table projections that FE cannot see. A reduced triggering 
plan is:
   
   ```text
   TopN(k ASC, ts ASC LIMIT 1)
     Iceberg FileScan(k INT, ts TIMESTAMP_NS)
       retained Parquet schema: k INT, ts DATE
   ```
   
   In one split/scanner, put `(k=100, ts=1000-01-01)` in physical RG0, followed 
by several full batches of `(k=0, ts=2024-01-02)`. `rebuild_projection` in 
`column_mapper.cpp` injects an `EvolutionCast` for `ts`; its 
DATE-to-TIMESTAMP_NS path forces strict conversion even when SQL strict casts 
are disabled. The existing 
`IcebergV2ReaderTest.DatePromotionToNanosecondsChecksOverflow` establishes this 
overflow behavior. Both FE order keys are safe slots, and the localized TopN 
predicate references only unchanged `k`, so neither safety gate sees that 
conversion.
   
   Physical order fails on RG0 before a bound exists. The new ordering can read 
valid low-key groups first, publish bound `k=0`, and skip RG0 at the footer 
recheck before its conversion executes. The struct-accessor projection 
safeguard does not inspect an independent top-level `ts` output. This is 
distinct from the existing explicit FE-expression threads.
   
   Include implicit projected materialization in the table-layer safety proof, 
preserve it on refresh, and add this multi-row-group error regression.



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