SEGMENTPARTITIONEDDISTINCTCOUNT
This section contains reference documentation for the SEGMENTPARTITIONEDDISTINCTCOUNT function.
Returns the count of distinct values of a column when the column is pre-partitioned for each segment, where there is no common value within different segments. This function calculates the exact count of distinct values within the segment, then simply sums up the results from different segments to get the final result.
Signature
SEGMENTPARTITIONEDDISTINCTCOUNT(colName)
The input column can be single-value or multi-value. For a multi-value column, Pinot counts each distinct value contained in the rows. The partitioning requirement still applies to every value: the same value must not occur in different segments.
With advanced null handling enabled, Pinot skips null rows. Without advanced null handling, the column's configured default null value contributes to the count. The function returns 0 when no non-null rows contribute.
Usage Examples
These examples are based on the Batch Quick Start.
select SEGMENTPARTITIONEDDISTINCTCOUNT(teamID) AS value
from baseballStats 149
Last updated
Was this helpful?

