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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindRelation.java:
##########
@@ -495,9 +497,10 @@ private static LogicalPlan 
checkAndAddDeleteSignFilter(LogicalOlapScan scan, Con
                 scan = scan.withPreAggStatus(PreAggStatus.off(
                         Column.DELETE_SIGN + " is used as conjuncts."));
             }
-            return new LogicalFilter<>(ImmutableSet.of(conjunct), scan);
+            LogicalPlan child = addCheckPolicy ? new 
LogicalCheckPolicy<>(scan) : scan;

Review Comment:
   [P1] Keep reconstruction filters below the policy mask
   
   With the marker inside these branch filters, policy expansion produces:
   
   ```text
   Filter(commit_tso/delete_sign/binlog_op)
     Project(mask(v), hidden slots...)
       Filter(row policy)
         Scan
   ```
   
   This is observably wrong for a supported custom mask containing a 
`NoneMovableFunction`. For example, `if(assert_true(v >= 0, 'bad'), v, NULL)` 
prevents `PushDownFilterThroughProject` from moving the reconstruction 
predicate below the project. A row with `v = -1` inserted after the requested 
snapshot is therefore masked first and raises `bad`, even though `commit_tso < 
targetTso` (and the right branch's operation filter) should exclude it from the 
historical image. There is a second failure mode because policy lookup asks 
about every scan output: if a provider returns an exact mask for delete-sign, 
commit-TSO, or binlog-operation, the mask Alias replaces that slot's ExprId 
while the parent filter still references the raw ExprId, and 
`CheckAfterRewrite` rejects the plan.
   
   This is distinct from the fixed visible-output thread: the outer projection 
now consumes the masked visible slot, but the branch-control filters still sit 
above the mask. Please make `CheckPolicy` absorb all branch reconstruction 
predicates below the mask project (including the left filter chain), and add a 
non-movable mask case with a post-snapshot/discarded row.



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