I had to add an override of `makeAggregateCombiner` to make this work with 
rollup during indexing. This is what I added which seemed to make it work and 
spit out values similar to the existing `hyperUnique` aggregator on the query 
side.

```
@Override
  public AggregateCombiner makeAggregateCombiner()
  {
    return new ObjectAggregateCombiner<HllSketch>()
    {
      private Union union = new Union(lgK);

      @Override
      public void reset(ColumnValueSelector selector)
      {
        union.reset();
        fold(selector);
      }

      @Override
      public void fold(ColumnValueSelector selector)
      {
        HllSketch sketch = (HllSketch) selector.getObject();
        if (sketch != null) {
          union.update(sketch);
        }
      }

      @Override
      public Class<HllSketch> classOfObject()
      {
        return HllSketch.class;
      }

      @Nullable
      @Override
      public HllSketch getObject()
      {
        return union.getResult(tgtHllType);
      }
    };
  }
```
I'm not certain if this is where this makes sense to be defined, or if it 
should be in `HllSketchBuildAggregatorFactory`

[ Full content available at: 
https://github.com/apache/incubator-druid/pull/5712 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to