- Newest
- Most votes
- Most comments
I have discovered that the count_distinct function in AWS Log Insights queries doesn't really return a distinct count! As per the documentation
Returns the number of unique values for the field. If the field has very high cardinality (contains many unique values), the value returned by count_distinct is just an approximation.
Apparently I can't just assume that a function returns an accurate result.
answered 4 years ago
I came here just to say I observed the same behavior. I also read the same "just an approximation" verbiage, but I didn't expect the approximation to be so bad that you'd get distinct > total. Also I see it with only 7000 records, which I wouldn't think of as "very high cardinality" (in my case, I downloaded and checked with bash and I have 6648 distinct records out of 6762).
answered a year ago
Relevant content
asked 5 years ago
