protected final String[] getFullPathFromRootToNode(N node) {
    List<String> nodeNames = new ArrayList<>();
    for (AncestorStackEntry entry : ancestorStack) {
      nodeNames.add(entry.node.getName());
      if (entry.node == node) {
        return nodeNames.toArray(new String[0]);
      }
    }
    nodeNames.add(node.getName());
    return nodeNames.toArray(new String[0]);
  }
Get full path from root to node.

@param node node must be concluded in ancestorStack or nextMatchedNode
@return full path from traverse start node to the specified node
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/tree/AbstractTreeVisitor.java