private void checkTargetPathsInCreateLogicalView(
      final Analysis analysis,
      final CreateLogicalViewStatement createLogicalViewStatement,
      final MPPQueryContext context) {
    final Pair<Boolean, String> checkResult = createLogicalViewStatement.checkTargetPaths();
    if (Boolean.FALSE.equals(checkResult.left)) {
      analysis.setFinishQueryAfterAnalyze(true);
      analysis.setFailStatus(
          RpcUtils.getStatus(
              TSStatusCode.ILLEGAL_PATH.getStatusCode(),
              "The path " + checkResult.right + " is illegal."));
      return;
    }
    // Make sure there are no redundant paths in targets. Note that redundant paths in source
    // are legal.
    final List<PartialPath> targetPathList = createLogicalViewStatement.getTargetPathList();
    final Set<String> targetStringSet = new HashSet<>();
    for (final PartialPath path : targetPathList) {
      final boolean repeatPathNotExist = targetStringSet.add(path.toString());
      if (!repeatPathNotExist) {
        analysis.setFinishQueryAfterAnalyze(true);
        analysis.setFailStatus(
            RpcUtils.getStatus(
                TSStatusCode.ILLEGAL_PATH.getStatusCode(),
                String.format("Path [%s] is redundant in target paths.", path)));
        return;
      }
    }
    // Make sure all paths are not under any templates
    try {
      for (final PartialPath path : createLogicalViewStatement.getTargetPathList()) {
        checkIsTemplateCompatible(path, null, context);
      }
    } catch (final Exception e) {
      analysis.setFinishQueryAfterAnalyze(true);
      analysis.setFailStatus(
          RpcUtils.getStatus(
              TSStatusCode.UNSUPPORTED_OPERATION.getStatusCode(),
              "Can not create view under template."));
    }
  }
@param pathList the paths you want to check
@param schemaTree the given schema tree
@return if all paths you give can be found in schema tree, return a pair of view paths and
    null; else return view paths and the non-exist path.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java