public static SeriesSchemaFetchScanNode deserialize(ByteBuffer byteBuffer) {
    PartialPath storageGroup = (PartialPath) PathDeserializeUtil.deserialize(byteBuffer);
    PathPatternTree patternTree = PathPatternTree.deserialize(byteBuffer);

    int templateNum = ReadWriteIOUtils.readInt(byteBuffer);
    Map<Integer, Template> templateMap = new HashMap<>();
    Template template;
    for (int i = 0; i < templateNum; i++) {
      template = new Template();
      template.deserialize(byteBuffer);
      templateMap.put(template.getId(), template);
    }
    boolean withTags = ReadWriteIOUtils.readBool(byteBuffer);
    boolean withAttributes = ReadWriteIOUtils.readBool(byteBuffer);
    boolean withTemplate = ReadWriteIOUtils.readBool(byteBuffer);
    boolean withAliasForce = ReadWriteIOUtils.readBool(byteBuffer);
    PlanNodeId planNodeId = PlanNodeId.deserialize(byteBuffer);
    return new SeriesSchemaFetchScanNode(
        planNodeId,
        storageGroup,
        patternTree,
        templateMap,
        withTags,
        withAttributes,
        withTemplate,
        withAliasForce);
  }
This class defines the scan task of schema fetcher.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/metadata/read/SeriesSchemaFetchScanNode.java