@Override
    protected Scope visitLoadTsFile(final LoadTsFile node, final Optional<Scope> scope) {
      queryContext.setQueryType(QueryType.WRITE);

      try (final LoadTsFileAnalyzer loadTsFileAnalyzer =
          new LoadTsFileAnalyzer(node, node.isGeneratedByPipe(), queryContext)) {
        loadTsFileAnalyzer.analyzeFileByFile(analysis);
      } catch (final Exception e) {
        final String exceptionMessage =
            String.format(
                "Failed to execute load tsfile statement %s. Detail: %s",
                node, e.getMessage() == null ? e.getClass().getName() : e.getMessage());
        analysis.setFinishQueryAfterAnalyze(true);
        analysis.setFailStatus(RpcUtils.getStatus(TSStatusCode.LOAD_FILE_ERROR, exceptionMessage));
      }

      return createAndAssignScope(node, scope);
    }
Visitor context represents local query scope (if exists). The invariant is that the local query
scopes hierarchy should always have outer query scope (if provided) as ancestor.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/StatementAnalyzer.java