title: Hyperunique Aggregations in Calcite-Druid Adapter
body: <p>In my Druid data source, I have a hyperUnique aggregation (ingestion time) on one of the fields.</p>
  
  <p>I am trying to do the equivalent of <code>COUNT(DISTINCT(&lt;hyperunique_field&gt;))</code> on this aggregated field.</p>
  
  <p>Is it supported in the Calcite Druid Adapter? If so, what is the correct way to go about it?</p>
  
  <p>In plywood, I can do <code>COUNT_DISTINCT</code>. Running this returns 0 counts.</p>
  
  <p><strong>SQL:</strong></p>
  
  <blockquote>
    <p>select floor("__time" to HOUR) time_bucket,”field_1", count(distinct(“ingestion_time_aggregated_field"))  as uniq from “datasource" where "__time" between '2017-01-01 00:00:00' and '2017-01-02 00:00:00' and “field_1" in (‘value_1') and “field_2”='value_2' and “field_3”='value_3' and “field_4”='value_4' group by floor("__time" to HOUR),”field_1" order by floor("__time" to HOUR);</p>
  </blockquote>
  
  <p><strong>ingestion_time_aggregated_field</strong>:</p>
  
  <pre><code>{"name": "ingestion_time_aggregated_field", "type": "hyperUnique","fieldName": “field” }
  </code></pre>