pyspark.sql.functions.countDistinct¶
-
pyspark.sql.functions.
countDistinct
(col: ColumnOrName, *cols: ColumnOrName) → pyspark.sql.column.Column[source]¶ Returns a new
Column
for distinct count ofcol
orcols
.An alias of
count_distinct()
, and it is encouraged to usecount_distinct()
directly.New in version 1.3.0.
Changed in version 3.4.0: Supports Spark Connect.