Details
-
Improvement
-
Resolution: Fixed
-
Major
-
5.5.0
Description
COUNT (expr), COUNT( DISTINCT expr) counts when the expression IS NOT NULL or IS NOT MISSING.
In json the types can be mixed and COUNT counts all of them
SUM(expr), AVG(expr) adds only number values.
If average is rewritten as AVG(expr) = SUM(expr)/COUNT(expr) the results will not match for mixed types.
Introducing COUNTN(expr), COUNTN( DISTINCT expr) which does on number values so that AVG(expr) can be used as SUM(expr)/COUNTN(expr)
This is needed for GROUP BY and aggregate pushdown . Same thing exposing to user also
Attachments
Issue Links
- relates to
-
DOC-4676 Document COUNTN
- Resolved
For Gerrit Dashboard: MB-26901 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
85724,3 | MB-26901. Add COUNTN() aggregate to count number values | master | query | Status: MERGED | +2 | +1 |
85785,2 | MB-26901. Fix test issues | master | query | Status: MERGED | +2 | +1 |