@Override
  public List<WritePlanNode> splitByPartition(IAnalysis analysis) {
    Map<TRegionReplicaSet, InsertRowsNode> splitMap = new HashMap<>();
    List<TEndPoint> redirectInfo = new ArrayList<>();
    for (int i = 0; i < insertRowNodeList.size(); i++) {
      InsertRowNode insertRowNode = insertRowNodeList.get(i);
      // Data region for insert row node
      // each row may belong to different database, pass null for auto-detection
      TRegionReplicaSet dataRegionReplicaSet =
          analysis
              .getDataPartitionInfo()
              .getDataRegionReplicaSetForWriting(
                  insertRowNode.targetPath.getIDeviceIDAsFullDevice(),
                  TimePartitionUtils.getTimePartitionSlot(insertRowNode.getTime()),
                  null);
      // Collect redirectInfo
      redirectInfo.add(dataRegionReplicaSet.getDataNodeLocations().get(0).getClientRpcEndPoint());
      InsertRowsNode tmpNode = splitMap.get(dataRegionReplicaSet);
      if (tmpNode != null) {
        tmpNode.addOneInsertRowNode(insertRowNode, i);
      } else {
        tmpNode = new InsertRowsNode(this.getPlanNodeId());
        tmpNode.setDataRegionReplicaSet(dataRegionReplicaSet);
        tmpNode.addOneInsertRowNode(insertRowNode, i);
        splitMap.put(dataRegionReplicaSet, tmpNode);
      }
    }
    analysis.setRedirectNodeList(redirectInfo);

    return new ArrayList<>(splitMap.values());
  }
Record the result of insert rows
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertRowsNode.java