diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalCheckPolicy.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalCheckPolicy.java index 1f7497e537c7501..bda3b1f49d570d4 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalCheckPolicy.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalCheckPolicy.java @@ -44,6 +44,7 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; +import org.apache.commons.collections.CollectionUtils; import java.util.ArrayList; import java.util.List; @@ -168,11 +169,8 @@ public RelatedPolicy findPolicy(LogicalRelation logicalRelation, CascadesContext List policies = accessManager.evalRowFilterPolicies( currentUserIdentity, ctlName, dbName, tableName); - if (policies.isEmpty()) { - return RelatedPolicy.NO_POLICY; - } return new RelatedPolicy( - Optional.ofNullable(mergeRowPolicy(policies)), + Optional.ofNullable(CollectionUtils.isEmpty(policies) ? null : mergeRowPolicy(policies)), hasDataMask ? Optional.of(dataMasks.build()) : Optional.empty() ); }