private void removeLogicViewMeasurement(SchemaNode parent) {
    if (parent.isMeasurement()) {
      return;
    }

    Map<String, SchemaNode> children = parent.getChildren();
    List<String> childrenToBeRemoved = new ArrayList<>();
    for (Map.Entry<String, SchemaNode> entry : children.entrySet()) {
      SchemaNode child = entry.getValue();
      if (child.isMeasurement() && child.getAsMeasurementNode().isLogicalView()) {
        childrenToBeRemoved.add(entry.getKey());
      } else {
        removeLogicViewMeasurement(child);
      }
    }

    for (String key : childrenToBeRemoved) {
      parent.removeChild(key);
    }
  }
Append a template device to the schema tree.

@param devicePath device path
@param isAligned whether the device is aligned
@param templateId template id
@param template template instance, used to search measurement schema, it can be null if
    write-only
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/schematree/ClusterSchemaTree.java