pyspark.sql.functions.
countDistinct
Returns a new Column for distinct count of col or cols.
Column
col
cols
An alias of count_distinct(), and it is encouraged to use count_distinct() directly.
count_distinct()
New in version 1.3.0.
Changed in version 3.4.0: Supports Spark Connect.