private Map<String, List<DataPartitionQueryParam>> splitDataPartitionQueryParam(
      final List<DataPartitionQueryParam> dataPartitionQueryParams,
      final boolean isAutoCreate,
      final String userName) {
    final List<IDeviceID> deviceIDs = new ArrayList<>();
    for (final DataPartitionQueryParam dataPartitionQueryParam : dataPartitionQueryParams) {
      deviceIDs.add(dataPartitionQueryParam.getDeviceID());
    }
    Map<IDeviceID, String> deviceToDatabase = null;
    final Map<String, List<DataPartitionQueryParam>> result = new HashMap<>();
    for (final DataPartitionQueryParam dataPartitionQueryParam : dataPartitionQueryParams) {
      final IDeviceID deviceID = dataPartitionQueryParam.getDeviceID();
      String database = null;
      if (dataPartitionQueryParam.getDatabaseName() == null) {
        if (deviceToDatabase == null) {
          deviceToDatabase =
              partitionCache.getDeviceToDatabase(deviceIDs, true, isAutoCreate, userName);
        }
        if (deviceToDatabase.containsKey(deviceID)) {
          database = deviceToDatabase.get(deviceID);
        }
      } else {
        database = dataPartitionQueryParam.getDatabaseName();
      }
      if (database != null) {
        result.computeIfAbsent(database, key -> new ArrayList<>()).add(dataPartitionQueryParam);
      }
    }
    return result;
  }
split data partition query param by database
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/ClusterPartitionFetcher.java