@Override
  public Analysis visitCreateLogicalView(
      CreateLogicalViewStatement createLogicalViewStatement, MPPQueryContext context) {
    Analysis analysis = new Analysis();
    context.setQueryType(QueryType.WRITE);
    analysis.setRealStatement(createLogicalViewStatement);

    if (createLogicalViewStatement.getViewExpressions() == null) {
      // Analyze query in statement
      QueryStatement queryStatement = createLogicalViewStatement.getQueryStatement();
      if (queryStatement != null) {
        Pair<List<Expression>, Analysis> queryAnalysisPair =
            this.analyzeQueryInLogicalViewStatement(analysis, queryStatement, context);
        if (queryAnalysisPair.right.isFinishQueryAfterAnalyze()) {
          return analysis;
        } else if (queryAnalysisPair.left != null) {
          try {
            createLogicalViewStatement.setSourceExpressions(queryAnalysisPair.left);
          } catch (UnsupportedViewException e) {
            analysis.setFinishQueryAfterAnalyze(true);
            analysis.setFailStatus(RpcUtils.getStatus(e.getErrorCode(), e.getMessage()));
            return analysis;
          }
        }
      }
      // Only check and use source paths when view expressions are not set because there
      // is no need to check source when renaming views and the check may not be satisfied
      // when the statement is generated by pipe

      // Use source and into item to generate target views
      // If expressions are filled the target paths must be filled likewise
      createLogicalViewStatement.parseIntoItemIfNecessary();

      checkSourcePathsInCreateLogicalView(analysis, createLogicalViewStatement);
      if (analysis.isFinishQueryAfterAnalyze()) {
        return analysis;
      }

      // Make sure there is no view in source
      List<Expression> sourceExpressionList = createLogicalViewStatement.getSourceExpressionList();
      checkViewsInSource(analysis, sourceExpressionList, context);
      if (analysis.isFinishQueryAfterAnalyze()) {
        return analysis;
      }
    }

    // Check target paths.
    checkTargetPathsInCreateLogicalView(analysis, createLogicalViewStatement, context);
    if (analysis.isFinishQueryAfterAnalyze()) {
      return analysis;
    }

    // Set schema partition info, this info will be used to split logical plan node.
    PathPatternTree patternTree = new PathPatternTree();
    for (PartialPath thisFullPath : createLogicalViewStatement.getTargetPathList()) {
      patternTree.appendFullPath(thisFullPath);
    }
    SchemaPartition schemaPartitionInfo =
        partitionFetcher.getOrCreateSchemaPartition(
            patternTree, context.getSession().getUserName());
    analysis.setSchemaPartitionInfo(schemaPartitionInfo);

    return analysis;
  }
Since we fetch raw time series schema without template(The template sequence will be treated
as a normal node, not a device+templateId. This means that all nodes are what we need.). We
can use ALL_MATCH_PATTERN to get result.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java