Define and add `countDistinct` aggregation for `Pivot` and `PivotGroupBy`
- Dominant language
- Kotlin
- Stars
- 1.1k
- Forks
- 83
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 30
Description
Follow up of #533.
The `countDistinct` is currently not defined on `Pivot` and `PivotGroupBy`. We need to add these overloads for the API consistency (for example, the `count` function has them) and more straightforward counting distinct values on these receivers.
Functionality to add:
- On `Pivot`:
`df.pivot { column_0 }.countDistinct()`
`df.pivot { column_0 }.countDistinct { column_1 }`
- On `PivotGroupBy`:
`df.pivot { column_0 }.groupBy { column_1 }.countDistinct()`
`df.pivot { column_0 }.groupBy { column_1 }.countDistinct { column_2 }`
Tests and KDocs should be added, relevant existing documentation (for `countDistinct` and `pivot`) should be updated.
Contributor guide
Research direction
Start by locating the existing count overloads for Pivot and PivotGroupBy and the current countDistinct and pivot documentation. Add the four requested overloads, tests, and KDocs, then update the relevant documentation; done means the listed examples compile and the tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100