public static AlterTimeSeriesNode deserialize(ByteBuffer byteBuffer) {
    String id;
    MeasurementPath path;
    AlterType alterType;
    String alias = null;
    Map<String, String> alterMap = null;
    Map<String, String> tagsMap = null;
    Map<String, String> attributesMap = null;

    int length = byteBuffer.getInt();
    byte[] bytes = new byte[length];
    byteBuffer.get(bytes);
    try {
      path = new MeasurementPath(new String(bytes, TSFileConfig.STRING_CHARSET));
    } catch (IllegalPathException e) {
      throw new IllegalArgumentException("Can not deserialize AlterTimeSeriesNode", e);
    }

    boolean isAlterView = false;
    int alterTypeOrdinal = byteBuffer.get();
    if (alterTypeOrdinal == -1) {
      isAlterView = true;
      alterTypeOrdinal = byteBuffer.get();
    }

    alterType = AlterType.values()[alterTypeOrdinal];

    // alias
    if (byteBuffer.get() == 1) {
      alias = ReadWriteIOUtils.readString(byteBuffer);
    }

    // alterMap
    byte label = byteBuffer.get();
    if (label == 0) {
      alterMap = new HashMap<>();
    } else if (label == 1) {
      alterMap = ReadWriteIOUtils.readMap(byteBuffer);
    }

    // tagsMap
    label = byteBuffer.get();
    if (label == 0) {
      tagsMap = new HashMap<>();
    } else if (label == 1) {
      tagsMap = ReadWriteIOUtils.readMap(byteBuffer);
    }

    // attributesMap
    label = byteBuffer.get();
    if (label == 0) {
      attributesMap = new HashMap<>();
    } else if (label == 1) {
      attributesMap = ReadWriteIOUtils.readMap(byteBuffer);
    }

    id = ReadWriteIOUtils.readString(byteBuffer);
    return new AlterTimeSeriesNode(
        new PlanNodeId(id), path, alterType, alterMap, alias, tagsMap, attributesMap, isAlterView);
  }
Used when the alterType is UPSERT.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/metadata/write/AlterTimeSeriesNode.java