docs: private static Map<Symbol, Aggregation> outputsAsInputs(Map<Symbol, Aggregation> assignments)
      {
          ImmutableMap.Builder<Symbol, Aggregation> builder = ImmutableMap.builder();
          for (Map.Entry<Symbol, Aggregation> entry : assignments.entrySet()) {
              Symbol output = entry.getKey();
              Aggregation aggregation = entry.getValue();
              checkState(!aggregation.getCall().getOrderBy().isPresent(), "Intermediate aggregation does not support ORDER BY");
              builder.put(
                      output,
                      new Aggregation(
                              new FunctionCall(aggregation.getCall().getName(), ImmutableList.of(output.toSymbolReference())),
                              aggregation.getFunctionHandle(),
                              Optional.empty()));  // No mask for INTERMEDIATE
          }
          return builder.build();
      }