Exact Count Distinct in Druid SQL

In this section http://druid.io/docs/latest/querying/sql#aggregation-functions, it says in order to get exact distinct count, useApproximateCountDistinct needs to be set to false. Could you tell me where I should set this? Inside a query or in which config file? Does this feature requires druid-distinctcount extension?

Hey Tc,

You would set this in the query context (see http://druid.io/docs/latest/querying/sql#connection-context).

Gian,

Thanks for the reply!

In order to get exact distinct count after setting useApproximateCountDistinct to be false, do I also need to turn on druid-distinctcount extension?

You don’t, it’s not really connected. The distinctcount extension is a community-contrib extension that only applies in certain specific scenarios (like its docs describe).