code: private List<Set<Filter>> constructPartitions(EntitySpec entitySpec,
              Set<Filter> filtersCopy) {
          PositionFilter positionFilter = null;
          for (Filter filter : filtersCopy) {
              if (filter instanceof PositionFilter) {
                  positionFilter = (PositionFilter) filter;
                  break;
              }
          }
          Unit partitionBy = entitySpec.getPartitionBy();
          List<Set<Filter>> filterList = new ArrayList<>();
          if (partitionBy == null
                  || positionFilter == null
                  || positionFilter.getStart() == null
                  || positionFilter.getFinish() == null
                  || !positionFilter.getStartSide().equals(
                          positionFilter.getFinishSide())) {
              filterList.add(filtersCopy);
          } else {
              Long start = positionFilter.getStart();
              Long actualFinish = positionFilter.getFinish();
              Granularity startGran = positionFilter.getStartGranularity();
              Granularity finishGran = positionFilter.getFinishGranularity();
              Unit finishUnit = finishGran != null ? finishGran.getCorrespondingUnit() : null;
              boolean doLoop = true;
              while (doLoop) {
                  Set<Filter> newFiltersCopy = new HashSet<>(filtersCopy);
                  newFiltersCopy.remove(positionFilter);
                  Long nextStart = partitionBy.addToPosition(start, 1);
                  Long finish = finishUnit != null ? finishUnit.addToPosition(
                          nextStart, -1) : -1;
                  if (finish.compareTo(actualFinish) >= 0) {
                      finish = actualFinish;
                      doLoop = false;
                  }
                  PositionFilter newPositionFilter = new PositionFilter(
                          positionFilter.getPropositionIds(), start, startGran,
                          finish, finishGran, positionFilter.getStartSide(),
                          positionFilter.getFinishSide());
                  newFiltersCopy.add(newPositionFilter);
                  filterList.add(newFiltersCopy);
                  start = nextStart;
              }
          }
          return filterList;
      }
docs: /*
  Partitions position filters according to the data source backend's
  configuration. This has the effect of splitting up one query into
  multiple queries to improve performance. Currently this only works when
  upper and lower bounds are provided on the same side of the specified
  proposition's intervals. If there are multiple position filters
  specified, which one gets chosen to partition is non-deterministic.