zddr commented on code in PR #23714:
URL: https://github.com/apache/doris/pull/23714#discussion_r1312473447


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/CheckPolicy.java:
##########
@@ -40,22 +41,34 @@ public class CheckPolicy implements AnalysisRuleFactory {
     @Override
     public List<Rule> buildRules() {
         return ImmutableList.of(
-            RuleType.CHECK_ROW_POLICY.build(
-                logicalCheckPolicy(any().when(child -> !(child instanceof 
UnboundRelation))).thenApply(ctx -> {
-                    LogicalCheckPolicy<Plan> checkPolicy = ctx.root;
-                    Plan child = checkPolicy.child();
-                    if (!(child instanceof LogicalRelation)
-                            || 
ctx.connectContext.getSessionVariable().isPlayNereidsDump()) {
-                        return child;
-                    }
-                    LogicalRelation relation = (LogicalRelation) child;
-                    Optional<Expression> filter = 
checkPolicy.getFilter(relation, ctx.connectContext);
-                    if (!filter.isPresent()) {
-                        return relation;
-                    }
-                    return new 
LogicalFilter(ExpressionUtils.extractConjunctionToSet(filter.get()), relation);
-                })
-            )
+                RuleType.CHECK_ROW_POLICY.build(
+                        logicalCheckPolicy(any().when(child -> !(child 
instanceof UnboundRelation))).thenApply(ctx -> {
+                            LogicalCheckPolicy<Plan> checkPolicy = ctx.root;
+                            LogicalFilter<Plan> upperFilter = null;
+
+                            Plan child = checkPolicy.child();
+                            if (child instanceof LogicalFilter && 
child.bound() && child

Review Comment:
   Because the unique table will automatically include a filter condition



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