private Optional<ConfigPhysicalPlan> visitTreeAuthorPlan(
      final AuthorTreePlan pathRelatedAuthorTreePlan, final IoTDBTreePattern pattern) {
    final List<PartialPath> intersectedPaths =
        pathRelatedAuthorTreePlan.getNodeNameList().stream()
            .map(pattern::getIntersection)
            .flatMap(Collection::stream)
            .collect(Collectors.toList());
    final Set<Integer> permissions =
        !intersectedPaths.isEmpty()
            ? pathRelatedAuthorTreePlan.getPermissions()
            : pathRelatedAuthorTreePlan.getPermissions().stream()
                .filter(permission -> !PrivilegeType.values()[permission].isPathPrivilege())
                .collect(Collectors.toSet());
    return !permissions.isEmpty()
        ? Optional.of(
            new AuthorTreePlan(
                pathRelatedAuthorTreePlan.getAuthorType(),
                pathRelatedAuthorTreePlan.getUserName(),
                pathRelatedAuthorTreePlan.getRoleName(),
                pathRelatedAuthorTreePlan.getPassword(),
                pathRelatedAuthorTreePlan.getNewPassword(),
                permissions,
                pathRelatedAuthorTreePlan.getGrantOpt(),
                intersectedPaths))
        : Optional.empty();
  }
The {@link PipeConfigPhysicalPlanTreePatternParseVisitor} will transform the schema {@link
ConfigPhysicalPlan}s using {@link IoTDBTreePattern}. Rule:

<p>1. All patterns in the output {@link ConfigPhysicalPlan} will be the intersection of the
original {@link ConfigPhysicalPlan}'s patterns and the given {@link IoTDBTreePattern}.

<p>2. If a pattern does not intersect with the {@link IoTDBTreePattern}, it's dropped.

<p>3. If all the patterns in the {@link ConfigPhysicalPlan} is dropped, the {@link
ConfigPhysicalPlan} is dropped.

<p>4. The output {@link PlanNode} shall be a copied form of the original one because the original
one is used in the {@link PipeConfigRegionWritePlanEvent} in {@link ConfigRegionListeningQueue}.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/extractor/PipeConfigPhysicalPlanTreePatternParseVisitor.java