public static PlanNode deserializeHelper(ByteBuffer byteBuffer, TypeProvider typeProvider) {
    PlanNode root;
    if (typeProvider != null && typeProvider.getTemplatedInfo() != null) {
      root = PlanNodeType.deserializeWithTemplate(byteBuffer, typeProvider);
      if (root instanceof AlignedSeriesScanNode
          || root instanceof AlignedSeriesAggregationScanNode) {
        return root;
      }
    } else {
      root = PlanNodeType.deserialize(byteBuffer);
    }

    int childrenCount = byteBuffer.getInt();
    for (int i = 0; i < childrenCount; i++) {
      root.addChild(deserializeHelper(byteBuffer, typeProvider));
    }
    return root;
  }
PlanFragment contains a sub-query of distributed query.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/PlanFragment.java