private boolean deletePathNode(
      PathPatternNode<V, VSerializer> node, String[] pathNodes, int pos, V value) {
    if (node == null) {
      return false;
    }
    if (pos == pathNodes.length - 1) {
      node.deleteValue(value, deleteFunction);
    } else {
      PathPatternNode<V, VSerializer> child = node.getChildren(pathNodes[pos + 1]);
      if (deletePathNode(child, pathNodes, pos + 1, value)) {
        node.deleteChild(child);
      }
    }
    return node.isLeaf() && node.getValues().isEmpty();
  }
Recursive method for deleting value.

@param node current PathPatternNode
@param pathNodes pathNodes of key
@param pos current index of pathNodes
@param value the value to be deleted
@return true if current PathPatternNode can be removed
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PatternTreeMap.java