docs: private static List<DimensionExpression> computeDimensions(
        final PartialDruidQuery partialQuery,
        final PlannerContext plannerContext,
        final DruidQuerySignature querySignature
    )
    {
      final Aggregate aggregate = Preconditions.checkNotNull(partialQuery.getAggregate());
      final List<DimensionExpression> dimensions = new ArrayList<>();
      final String outputNamePrefix = Calcites.findUnusedPrefix(
          "d",
          new TreeSet<>(querySignature.getRowSignature().getRowOrder())
      );
      int outputNameCounter = 0;
  
      for (int i : aggregate.getGroupSet()) {
        // Dimension might need to create virtual columns. Avoid giving it a name that would lead to colliding columns.
        final RexNode rexNode = Expressions.fromFieldAccess(
            querySignature.getRowSignature(),
            partialQuery.getSelectProject(),
            i
        );
        final DruidExpression druidExpression = Expressions.toDruidExpression(
            plannerContext,
            querySignature.getRowSignature(),
            rexNode
        );
        if (druidExpression == null) {
          throw new CannotBuildQueryException(aggregate, rexNode);
        }
  
        final SqlTypeName sqlTypeName = rexNode.getType().getSqlTypeName();
        final ValueType outputType = Calcites.getValueTypeForSqlTypeName(sqlTypeName);
        if (outputType == null || outputType == ValueType.COMPLEX) {
          // Can't group on unknown or COMPLEX types.
          throw new CannotBuildQueryException(aggregate, rexNode);
        }
  
        final VirtualColumn virtualColumn;
  
        final String dimOutputName;
        if (!druidExpression.isSimpleExtraction()) {
          virtualColumn = querySignature.getOrCreateVirtualColumnForExpression(
              plannerContext,
              druidExpression,
              sqlTypeName
          );
          dimOutputName = virtualColumn.getOutputName();
        } else {
          dimOutputName = outputNamePrefix + outputNameCounter++;
        }
  
        dimensions.add(new DimensionExpression(dimOutputName, druidExpression, outputType));
      }
  
      return dimensions;
    }