Skip to content

Commit

Permalink
Added a Python test.
Browse files Browse the repository at this point in the history
  • Loading branch information
rxin committed Feb 5, 2015
1 parent f4b8dbb commit c55f5fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/pyspark/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -2638,6 +2638,9 @@ def countDistinct(col, *cols):
>>> from pyspark.sql import Dsl
>>> df.agg(Dsl.countDistinct(df.age, df.name).alias('c')).collect()
[Row(c=2)]
>>> df.agg(Dsl.countDistinct("age", "name").alias('c')).collect()
[Row(c=2)]
"""
sc = SparkContext._active_spark_context
jcols = ListConverter().convert([_to_java_column(c) for c in cols],
Expand Down

0 comments on commit c55f5fa

Please sign in to comment.