Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 966 Bytes

segmentpartitioneddistinctcount.md

File metadata and controls

30 lines (21 loc) · 966 Bytes
description
This section contains reference documentation for the SEGMENTPARTITIONEDDISTINCTCOUNT function.

SEGMENTPARTITIONEDDISTINCTCOUNT

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.

{% hint style="warning" %} This function relies on the expression values being partitioned for each segment, where there are no common values within different segments. {% endhint %}

Signature

SEGMENTPARTITIONEDDISTINCTCOUNT(colName)

Usage Examples

These examples are based on the Batch Quick Start.

select SEGMENTPARTITIONEDDISTINCTCOUNT(teamID) AS value
from baseballStats 
value
149