code: private static Map<Symbol, Aggregation> inputsAsOutputs(Map<Symbol, Aggregation> assignments)
      {
          ImmutableMap.Builder<Symbol, Aggregation> builder = ImmutableMap.builder();
          for (Map.Entry<Symbol, Aggregation> entry : assignments.entrySet()) {
              // Should only have one input symbol
              Symbol input = getOnlyElement(SymbolsExtractor.extractAll(entry.getValue().getCall()));
              builder.put(input, entry.getValue());
          }
          return builder.build();
      }
docs: Rewrite assignments so that outputs are in terms of the input symbols.
  This operation only reliably applies to aggregation steps that take partial inputs (e.g. INTERMEDIATE and split FINALs),
  which are guaranteed to have exactly one input and one output.
  <p>
  Example:
  'a' := sum('b') => 'b' := sum('b')