private PartialPath convertNodesToPartialPath(
      PathPatternNode<Void, VoidSerializer> node,
      Deque<String> ancestors,
      boolean asMeasurementPath) {
    Iterator<String> iterator = ancestors.descendingIterator();
    List<String> nodeList = new ArrayList<>(ancestors.size() + 1);
    while (iterator.hasNext()) {
      nodeList.add(iterator.next());
    }
    nodeList.add(node.getName());
    if (asMeasurementPath) {
      return new MeasurementPath(nodeList.toArray(new String[0]));
    } else {
      return new PartialPath(nodeList.toArray(new String[0]));
    }
  }
Construct tree according to the pathPatternList.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PathPatternTree.java