public void serialize(DataOutputStream stream) throws IOException {
    serializeAttributes(stream);
    id.serialize(stream);
    List<PlanNode> planNodes = getChildren();
    if (planNodes == null) {
      ReadWriteIOUtils.write(0, stream);
    } else {
      ReadWriteIOUtils.write(planNodes.size(), stream);
      for (PlanNode planNode : planNodes) {
        planNode.serialize(stream);
      }
    }
  }
Create sub node which has exactly the same function of origin node, only its children is a part
of it, which is composed by the [startIndex, endIndex) of origin children list.

@param subNodeId the sub node id
@param startIndex the start Index of origin children
@param endIndex the endIndex Index of origin children
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/PlanNode.java