Skip to content

Commit 79059fd

Browse files
author
Davies Liu
committed
add test
1 parent cb4915e commit 79059fd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

python/pyspark/sql/dataframe.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,18 @@ def unpersist(self, blocking=True):
417417
def repartition(self, numPartitions):
418418
""" Return a new :class:`DataFrame` that has exactly `numPartitions`
419419
partitions.
420+
421+
>>> df.repartition(10).rdd.getNumPartitions()
422+
10
420423
"""
421424
return DataFrame(self._jdf.repartition(numPartitions), self.sql_ctx)
422425

423426
def distinct(self):
424427
"""
425428
Return a new :class:`DataFrame` containing the distinct rows in this DataFrame.
429+
430+
>>> df.distinct().count()
431+
2L
426432
"""
427433
return DataFrame(self._jdf.distinct(), self.sql_ctx)
428434

0 commit comments

Comments
 (0)