private UpdateLastCacheOperator createUpdateLastCacheOperator(
      final LastQueryScanNode node,
      final LocalExecutionPlanContext context,
      final MeasurementPath fullPath) {
    final SeriesAggregationScanOperator lastQueryScan = createLastQueryScanOperator(node, context);
    final OperatorContext operatorContext =
        context
            .getDriverContext()
            .addOperatorContext(
                context.getNextOperatorId(),
                node.getPlanNodeId(),
                UpdateLastCacheOperator.class.getSimpleName());

    final boolean isNeedUpdateLastCache = context.isNeedUpdateLastCache();
    if (isNeedUpdateLastCache) {
      TreeDeviceSchemaCacheManager.getInstance()
          .updateLastCache(
              ((DataDriverContext) operatorContext.getDriverContext())
                  .getDataRegion()
                  .getDatabaseName(),
              fullPath,
              false);
    }

    return Objects.isNull(node.getOutputViewPath())
        ? new UpdateLastCacheOperator(
            operatorContext,
            lastQueryScan,
            fullPath,
            node.getSeriesPath().getSeriesType(),
            DATA_NODE_SCHEMA_CACHE,
            isNeedUpdateLastCache,
            context.isNeedUpdateNullEntry())
        : new UpdateViewPathLastCacheOperator(
            operatorContext,
            lastQueryScan,
            fullPath,
            node.getSeriesPath().getSeriesType(),
            DATA_NODE_SCHEMA_CACHE,
            isNeedUpdateLastCache,
            context.isNeedUpdateNullEntry(),
            node.getOutputViewPath());
  }
This Visitor is responsible for transferring PlanNode Tree to Operator Tree.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/OperatorTreeGenerator.java