@Override
  protected void serializeAttributes(ByteBuffer byteBuffer) {
    PlanNodeType.ALTER_TIME_SERIES.serialize(byteBuffer);
    byte[] bytes = path.getFullPath().getBytes();
    ReadWriteIOUtils.write(bytes.length, byteBuffer);
    byteBuffer.put(bytes);

    if (isAlterView) {
      byteBuffer.put((byte) -1);
    }
    byteBuffer.put((byte) alterType.ordinal());

    // alias
    if (alias != null) {
      byteBuffer.put((byte) 1);
      ReadWriteIOUtils.write(alias, byteBuffer);
    } else {
      byteBuffer.put((byte) 0);
    }

    // alterMap
    if (alterMap == null) {
      byteBuffer.put((byte) -1);
    } else if (alterMap.isEmpty()) {
      byteBuffer.put((byte) 0);
    } else {
      byteBuffer.put((byte) 1);
      ReadWriteIOUtils.write(alterMap, byteBuffer);
    }

    // tagsMap
    if (tagsMap == null) {
      byteBuffer.put((byte) -1);
    } else if (tagsMap.isEmpty()) {
      byteBuffer.put((byte) 0);
    } else {
      byteBuffer.put((byte) 1);
      ReadWriteIOUtils.write(tagsMap, byteBuffer);
    }

    // attributesMap
    if (attributesMap == null) {
      byteBuffer.put((byte) -1);
    } else if (attributesMap.isEmpty()) {
      byteBuffer.put((byte) 0);
    } else {
      byteBuffer.put((byte) 1);
      ReadWriteIOUtils.write(attributesMap, byteBuffer);
    }
  }
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