Difference between Count and longSum. Are there values approximate or correct ?

Hi,

I am querying Druid database with different kind of Aggregation functions. I have few questions

Assume there are records like

r_cnt,reqid,

1,A

1,B

1,C

Assume we defined the longSum aggregation in r_cnt column, r_cnt value is always 1 and we have millions of records.

In the above case, what is the difference between count and longSum ?

Whether these values are approximate or correct values ?

Count returns the number of rolled-up rows. longSum returns the sum of a column when it is cast to a long value.

If reqid is unique then they should be the same.

If reqid is NOT unique, but is unique in every QueryGranularity, then they should be the same

If reqid is NOT unique, and may be duplicated in the same QueryGranularity, then they may or may not be the same (count might be lower) depending on how ingestion was done.

Please see: http://druid.io/docs/latest/design/index.html to learn about rollup