public AggregateNode(Compiler compiler, Aggregate rel) { super(compiler, rel); this.dataContext = compiler.getDataContext(); ImmutableBitSet union = ImmutableBitSet.of(); if (rel.getGroupSets() != null) { for (ImmutableBitSet group : rel.getGroupSets()) { union = union.union(group); groups.add(new Grouping(group)); } } this.unionGroups = union; this.outputRowLength = unionGroups.cardinality() + (rel.indicator ? unionGroups.cardinality() : 0) + rel.getAggCallList().size(); ImmutableList.Builder<AccumulatorFactory> builder = ImmutableList.builder(); for (AggregateCall aggregateCall : rel.getAggCallList()) { builder.add(getAccumulator(aggregateCall, false)); } accumulatorFactories = builder.build(); }
public AggregateNode(Compiler compiler, Aggregate rel) { super(compiler, rel); this.dataContext = compiler.getDataContext(); ImmutableBitSet union = ImmutableBitSet.of(); if (rel.getGroupSets() != null) { for (ImmutableBitSet group : rel.getGroupSets()) { union = union.union(group); groups.add(new Grouping(group)); } } this.unionGroups = union; this.outputRowLength = unionGroups.cardinality() + (rel.indicator ? unionGroups.cardinality() : 0) + rel.getAggCallList().size(); ImmutableList.Builder<AccumulatorFactory> builder = ImmutableList.builder(); for (AggregateCall aggregateCall : rel.getAggCallList()) { builder.add(getAccumulator(aggregateCall, false)); } accumulatorFactories = builder.build(); }