private void analyzeLastSource(
      Analysis analysis,
      List<Expression> selectExpressions,
      ISchemaTree schemaTree,
      MPPQueryContext context) {
    Set<Expression> sourceExpressions = new LinkedHashSet<>();
    Set<Expression> lastQueryBaseExpressions = new LinkedHashSet<>();
    Map<Expression, List<Expression>> lastQueryNonWritableViewSourceExpressionMap = null;

    for (Expression selectExpression : selectExpressions) {
      for (Expression lastQuerySourceExpression :
          bindSchemaForExpression(selectExpression, schemaTree, context)) {
        if (lastQuerySourceExpression instanceof TimeSeriesOperand) {
          lastQueryBaseExpressions.add(lastQuerySourceExpression);
          sourceExpressions.add(lastQuerySourceExpression);
        } else {
          if (lastQueryNonWritableViewSourceExpressionMap == null) {
            lastQueryNonWritableViewSourceExpressionMap = new HashMap<>();
          }
          List<Expression> sourceExpressionsOfNonWritableView =
              searchSourceExpressions(lastQuerySourceExpression);
          lastQueryNonWritableViewSourceExpressionMap.putIfAbsent(
              lastQuerySourceExpression, sourceExpressionsOfNonWritableView);
          sourceExpressions.addAll(sourceExpressionsOfNonWritableView);
        }
      }
    }

    analysis.setSourceExpressions(sourceExpressions);
    analysis.setLastQueryBaseExpressions(lastQueryBaseExpressions);
    analysis.setLastQueryNonWritableViewSourceExpressionMap(
        lastQueryNonWritableViewSourceExpressionMap);
  }
This visitor is used to analyze each type of Statement and returns the {@link Analysis}.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java