docs: private Ordering<Row> getRowOrderingForPushDown(
        final boolean granular,
        final DefaultLimitSpec limitSpec
    )
    {
      final boolean sortByDimsFirst = getContextSortByDimsFirst();
  
      final List<String> orderedFieldNames = new ArrayList<>();
      final Set<Integer> dimsInOrderBy = new HashSet<>();
      final List<Boolean> needsReverseList = new ArrayList<>();
      final List<ValueType> dimensionTypes = new ArrayList<>();
      final List<StringComparator> comparators = new ArrayList<>();
  
      for (OrderByColumnSpec orderSpec : limitSpec.getColumns()) {
        boolean needsReverse = orderSpec.getDirection() != OrderByColumnSpec.Direction.ASCENDING;
        int dimIndex = OrderByColumnSpec.getDimIndexForOrderBy(orderSpec, dimensions);
        if (dimIndex >= 0) {
          DimensionSpec dim = dimensions.get(dimIndex);
          orderedFieldNames.add(dim.getOutputName());
          dimsInOrderBy.add(dimIndex);
          needsReverseList.add(needsReverse);
          final ValueType type = dimensions.get(dimIndex).getOutputType();
          dimensionTypes.add(type);
          comparators.add(orderSpec.getDimensionComparator());
        }
      }
  
      for (int i = 0; i < dimensions.size(); i++) {
        if (!dimsInOrderBy.contains(i)) {
          orderedFieldNames.add(dimensions.get(i).getOutputName());
          needsReverseList.add(false);
          final ValueType type = dimensions.get(i).getOutputType();
          dimensionTypes.add(type);
          comparators.add(StringComparators.LEXICOGRAPHIC);
        }
      }
  
      final Comparator<Row> timeComparator = getTimeComparator(granular);
  
      if (timeComparator == null) {
        return Ordering.from(
            new Comparator<Row>()
            {
              @Override
              public int compare(Row lhs, Row rhs)
              {
                return compareDimsForLimitPushDown(
                    orderedFieldNames,
                    needsReverseList,
                    dimensionTypes,
                    comparators,
                    lhs,
                    rhs
                );
              }
            }
        );
      } else if (sortByDimsFirst) {
        return Ordering.from(
            new Comparator<Row>()
            {
              @Override
              public int compare(Row lhs, Row rhs)
              {
                final int cmp = compareDimsForLimitPushDown(
                    orderedFieldNames,
                    needsReverseList,
                    dimensionTypes,
                    comparators,
                    lhs,
                    rhs
                );
                if (cmp != 0) {
                  return cmp;
                }
  
                return timeComparator.compare(lhs, rhs);
              }
            }
        );
      } else {
        return Ordering.from(
            new Comparator<Row>()
            {
              @Override
              public int compare(Row lhs, Row rhs)
              {
                final int timeCompare = timeComparator.compare(lhs, rhs);
  
                if (timeCompare != 0) {
                  return timeCompare;
                }
  
                return compareDimsForLimitPushDown(
                    orderedFieldNames,
                    needsReverseList,
                    dimensionTypes,
                    comparators,
                    lhs,
                    rhs
                );
              }
            }
        );
      }
    }