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


##########
be/src/storage/segment/segment_iterator.cpp:
##########
@@ -1265,6 +1272,25 @@ Status SegmentIterator::_apply_index_expr() {
             break;
         }
         ++considered_conjuncts;
+        // A hidden placeholder column's inverted index holds the on-disk 
placeholder, not the value
+        // rows come back with. Evaluating a pushed-down conjunct that 
references one against the
+        // index (e.g. `__DORIS_VERSION_COL__ = <real version> AND indexed_col 
= ...`) would drop
+        // matching rows before read-time substitution, so leave the whole 
conjunct to the row-level
+        // path, which sees the substituted value.
+        {
+            std::set<int> expr_column_ids;
+            expr_ctx->root()->collect_slot_column_ids(expr_column_ids);

Review Comment:
   [P2] Fence placeholder sources behind virtual slots
   
   `VirtualSlotRef::collect_slot_column_ids()` reports only the virtual output 
ordinal, although the underlying expression supplies the virtual column value. 
With `experimental_enable_virtual_slot_for_cse=true`, repeating 
`(__DORIS_VERSION_COL__ = realVersion OR v = -1)` in SELECT/WHERE can turn that 
Boolean into a virtual scan column. This check misses the source version cid, 
and the adjacent `_virtual_column_exprs` loop evaluates the source indexes 
without any placeholder fence. `_output_index_result_column()` plus 
`fast_execute()` can then project `false` from the physical version-0 bitmap 
even though row-level evaluation against the substituted version is `true`. 
Please recurse through `get_virtual_column_expr()` (as 
`_mark_common_expr_states()` already does), fence the virtual-projection index 
loop too, and add a CSE-enabled version-column 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