Source:
<code>public PhysicalOperation visitTableFinish(TableFinishNode node, LocalExecutionPlanContext context) { PhysicalOperation source = node.getSource().accept(this, context); ImmutableMap.Builder<Symbol, Integer> outputMapping = ImmutableMap.builder(); OperatorFactory statisticsAggregation = node.getStatisticsAggregation().map(aggregation -> { List<Symbol> groupingKeys = aggregation.getGroupingSets() .stream() .flatMap(List::stream) <START> .collect(toImmutableList()); <END> if (groupingKeys.isEmpty()) { return createAggregationOperatorFactory( node.getId(), aggregation.getAggregations(), FINAL, 0, outputMapping, source, context); } else { return createHashAggregationOperatorFactory( node.getId(), aggregation.getAggregations(), aggregation.getGroupingSets(), groupingKeys, FINAL, Optional.empty(), Optional.empty(), source, false, false, new DataSize(0, BYTE), context, 0, outputMapping); } }).orElse(new NoOpOperatorFactory(context.getNextOperatorId(), node.getId())); Map<Symbol, Integer> aggregationOutput = outputMapping.build(); StatisticAggregationsDescriptor<Integer> descriptor = node.getStatisticsAggregationDescriptor() .map(desc -> desc.map(aggregationOutput::get)) .orElse(StatisticAggregationsDescriptor.<Integer>builder().build()); OperatorFactory operatorFactory = new TableFinishOperatorFactory( context.getNextOperatorId(), node.getId(), createTableFinisher(session, node, metadata), statisticsAggregation, descriptor); Map<Symbol, Integer> layout = ImmutableMap.of(node.getOutputSymbols().get(0), 0); return new PhysicalOperation(operatorFactory, layout, context, source); }</code><technical_language>Nit: stream previous line</technical_language>

Target:
public PhysicalOperation visitTableFinish(TableFinishNode node, LocalExecutionPlanContext context) { PhysicalOperation source = node.getSource().accept(this, context); ImmutableMap.Builder<Symbol, Integer> outputMapping = ImmutableMap.builder(); OperatorFactory statisticsAggregation = node.getStatisticsAggregation().map(aggregation -> { List<Symbol> groupingSymbols = aggregation.getGroupingSymbols(); if (groupingSymbols.isEmpty()) { return createAggregationOperatorFactory( node.getId(), aggregation.getAggregations(), FINAL, 0, outputMapping, source, context); } else { return createHashAggregationOperatorFactory( node.getId(), aggregation.getAggregations(), ImmutableList.of(groupingSymbols), groupingSymbols, FINAL, Optional.empty(), Optional.empty(), source, false, false, false, new DataSize(0, BYTE), context, 0, outputMapping); } }).orElse(new NoOpOperatorFactory(context.getNextOperatorId(), node.getId())); Map<Symbol, Integer> aggregationOutput = outputMapping.build(); StatisticAggregationsDescriptor<Integer> descriptor = node.getStatisticsAggregationDescriptor() .map(desc -> desc.map(aggregationOutput::get)) .orElse(StatisticAggregationsDescriptor.<Integer>builder().build()); OperatorFactory operatorFactory = new TableFinishOperatorFactory( context.getNextOperatorId(), node.getId(), createTableFinisher(session, node, metadata), statisticsAggregation, descriptor); Map<Symbol, Integer> layout = ImmutableMap.of(node.getOutputSymbols().get(0), 0); return new PhysicalOperation(operatorFactory, layout, context, source); }