@Override
  public void serialize(OutputStream stream) throws IOException {
    PathType.Measurement.serialize(stream);
    super.serializeWithoutType(stream);
    if (measurementSchema == null) {
      ReadWriteIOUtils.write((byte) 0, stream);
    } else {
      ReadWriteIOUtils.write((byte) 1, stream);
      MeasurementSchemaType measurementSchemaType = measurementSchema.getSchemaType();
      ReadWriteIOUtils.write(measurementSchemaType.getMeasurementSchemaTypeInByteEnum(), stream);
      measurementSchema.serializeTo(stream);
    }
    if (tagMap == null) {
      ReadWriteIOUtils.write((byte) 0, stream);
    } else {
      ReadWriteIOUtils.write((byte) 1, stream);
      ReadWriteIOUtils.write(tagMap, stream);
    }
    ReadWriteIOUtils.write(isUnderAlignedEntity, stream);
    ReadWriteIOUtils.write(measurementAlias, stream);
  }
if isUnderAlignedEntity is true, return an AlignedPath with only one sub sensor otherwise,
return itself
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/MeasurementPath.java