public static GroupByParams build(
      final LogicalSchema sourceSchema,
      final List<CompiledExpression> groupBys,
      final ProcessingLogger logger
  ) {
    if (groupBys.isEmpty()) {
      throw new IllegalArgumentException("No GROUP BY groupBys");
    }

    final Grouper grouper = buildGrouper(sourceSchema, groupBys, logger);

    return new GroupByParams(grouper.getSchema(), grouper::apply);
  }
@Test(expected = IllegalArgumentException.class)
  public void shouldThrowOnEmptyParam() {
    GroupByParamsFactory
        .build(SOURCE_SCHEMA, Collections.emptyList(), logger);
  }