@Override
  public Result apply(OffsetNode parent, Captures captures, Context context) {
    TableScanNode tableScanNode = captures.get(CHILD);
    if (tableScanNode instanceof DeviceTableScanNode
        && !((DeviceTableScanNode) tableScanNode).isPushLimitToEachDevice()) {
      tableScanNode.setPushDownOffset(parent.getCount());
      // consider case that there is no limit
      tableScanNode.setPushDownLimit(
          tableScanNode.getPushDownLimit() == 0
              ? 0
              : tableScanNode.getPushDownLimit() - parent.getCount());
      return Result.ofPlanNode(tableScanNode);
    }

    return Result.empty();
  }
<b>Optimization phase:</b> Distributed plan planning.

<p>The OFFSET can be eliminated when the following conditions are met:
<li>Its child is DeviceTableScan, which means there OFFSET is effect on only one region
<li>The query expressions are all scalar expression.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/iterative/rule/PushDownOffsetIntoTableScan.java