jt2594838 commented on code in PR #16531:
URL: https://github.com/apache/iotdb/pull/16531#discussion_r2596944812


##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/source/IoTDBConfigRegionSource.java:
##########
@@ -223,15 +246,20 @@ protected Optional<PipeWritePlanEvent> 
trimRealtimeEventByPrivilege(
     final ConfigPhysicalPlan plan =
         ((PipeConfigRegionWritePlanEvent) event).getConfigPhysicalPlan();
     final Boolean isTableDatabasePlan = isTableDatabasePlan(plan);
-    if (Boolean.FALSE.equals(isTableDatabasePlan)) {
-      return Optional.of(event);
+    if (!Boolean.TRUE.equals(isTableDatabasePlan)) {
+      final Optional<ConfigPhysicalPlan> result = 
treePrivilegeParseVisitor.process(plan, userName);
+      if (result.isPresent()) {
+        return Optional.of(
+            new PipeConfigRegionWritePlanEvent(result.get(), 
event.isGeneratedByPipe()));
+      }
     }
-
-    final Optional<ConfigPhysicalPlan> result =
-        TABLE_PRIVILEGE_PARSE_VISITOR.process(plan, userName);
-    if (result.isPresent()) {
-      return Optional.of(
-          new PipeConfigRegionWritePlanEvent(result.get(), 
event.isGeneratedByPipe()));
+    if (!Boolean.FALSE.equals(isTableDatabasePlan)) {

Review Comment:
   This adds some difficulty for understanding.
   Is it possible to process the `null` condition first, so that each branch 
will become more clear?



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

Reply via email to