protected final int getLevelOfNextMatchedNode() {
    if (shouldVisitSubtree) {
      return ancestorStack.size() - 1;
    } else {
      return ancestorStack.size();
    }
  }
Get level from root to NextMatchedNode. Level of root is 0. For example, root.sg.d1.s1,
NextMatchedNode is s1, then return 3.

@return level from root to NextMatchedNode
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/tree/AbstractTreeVisitor.java