private boolean matchPath(
      String[] pathNodes,
      int pathIndex,
      int patternIndex,
      boolean multiLevelWild,
      boolean pathIsPrefix) {
    if (pathIndex == pathNodes.length && patternIndex == nodes.length) {
      return true;
    } else if (patternIndex == nodes.length && multiLevelWild) {
      return matchPath(pathNodes, pathIndex + 1, patternIndex, true, pathIsPrefix);
    } else if (pathIndex >= pathNodes.length) {
      return pathIsPrefix;
    } else if (patternIndex >= nodes.length) {
      return false;
    }

    String pathNode = pathNodes[pathIndex];
    String patternNode = nodes[patternIndex];
    boolean isMatch = false;
    if (patternNode.equals(MULTI_LEVEL_PATH_WILDCARD)) {
      isMatch = matchPath(pathNodes, pathIndex + 1, patternIndex + 1, true, pathIsPrefix);
    } else {
      if (PathPatternUtil.hasWildcard(patternNode)) {
        if (PathPatternUtil.isNodeMatch(patternNode, pathNode)) {
          isMatch = matchPath(pathNodes, pathIndex + 1, patternIndex + 1, false, pathIsPrefix);
        }
      } else {
        if (patternNode.equals(pathNode)) {
          isMatch = matchPath(pathNodes, pathIndex + 1, patternIndex + 1, false, pathIsPrefix);
        }
      }

      if (!isMatch && multiLevelWild) {
        isMatch = matchPath(pathNodes, pathIndex + 1, patternIndex, true, pathIsPrefix);
      }
    }
    return isMatch;
  }
Check if current pattern PartialPath can match 1 prefix path.

<p>1) Current partialPath acts as a full path pattern.

<p>2) Input parameter prefixPath is 1 prefix of time-series path.

<p>For example:

<p>1) Pattern "root.sg1.d1.*" can match prefix path "root.sg1.d1.s1", "root.sg1.d1",
"root.sg1", "root" etc.

<p>1) Pattern "root.sg1.d1.*" does not match prefix path "root.sg2", "root.sg1.d2".

@param prefixPath
@return {@code true} if a successful match, otherwise return {@code false}
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java