@Override
  public Optional<PlanNode> visitCreateAlignedTimeSeries(
      final CreateAlignedTimeSeriesNode node, final IoTDBTreePattern pattern) {
    final int[] filteredIndexes =
        IntStream.range(0, node.getMeasurements().size())
            .filter(
                index ->
                    pattern.matchesMeasurement(
                        node.getDevicePath().getIDeviceIDAsFullDevice(),
                        node.getMeasurements().get(index)))
            .toArray();
    return filteredIndexes.length > 0
        ? Optional.of(
            new CreateAlignedTimeSeriesNode(
                node.getPlanNodeId(),
                node.getDevicePath(),
                IoTDBTreePattern.applyIndexesOnList(filteredIndexes, node.getMeasurements()),
                IoTDBTreePattern.applyIndexesOnList(filteredIndexes, node.getDataTypes()),
                IoTDBTreePattern.applyIndexesOnList(filteredIndexes, node.getEncodings()),
                IoTDBTreePattern.applyIndexesOnList(filteredIndexes, node.getCompressors()),
                IoTDBTreePattern.applyIndexesOnList(filteredIndexes, node.getAliasList()),
                IoTDBTreePattern.applyIndexesOnList(filteredIndexes, node.getTagsList()),
                IoTDBTreePattern.applyIndexesOnList(filteredIndexes, node.getAttributesList())))
        : Optional.empty();
  }
The {@link PipePlanTreePatternParseVisitor} will transform the schema {@link PlanNode}s using
{@link IoTDBTreePattern}. Rule:

<p>1. All patterns in the output {@link PlanNode} will be the intersection of the original {@link
PlanNode}'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 PlanNode} is dropped, the {@link PlanNode} 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 PipeSchemaRegionWritePlanEvent} in {@link SchemaRegionListeningQueue}.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/schemaregion/PipePlanTreePatternParseVisitor.java