pyspark.sql.functions.countDistinct

pyspark.sql.functions.countDistinct(col: ColumnOrName, *cols: ColumnOrName) → pyspark.sql.column.Column

Returns a new Column for distinct count of col or cols.

An alias of count_distinct(), and it is encouraged to use count_distinct() directly.