public void serialize(ByteBuffer byteBuffer) {
    id.serialize(byteBuffer);
    planNodeTree.serialize(byteBuffer);
    if (typeProvider == null) {
      ReadWriteIOUtils.write((byte) 0, byteBuffer);
    } else {
      ReadWriteIOUtils.write((byte) 1, byteBuffer);
      typeProvider.serialize(byteBuffer);
    }
  }
PlanFragment contains a sub-query of distributed query.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/PlanFragment.java