Skip to content

Commit

Permalink
add repartition
Browse files Browse the repository at this point in the history
  • Loading branch information
Davies Liu committed Jan 27, 2015
1 parent 6bf2b73 commit 257b9e6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/pyspark/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -2043,10 +2043,12 @@ def unpersist(self, blocking=True):
# rdd = self._jdf.coalesce(numPartitions, shuffle, None)
# return DataFrame(rdd, self.sql_ctx)

# def repartition(self, numPartitions):
# rdd = self._jdf.repartition(numPartitions, None)
# return DataFrame(rdd, self.sql_ctx)
#
def repartition(self, numPartitions):
""" Return a new :class:`DataFrame` that has exactly `numPartitions`
partitions.
"""
rdd = self._jdf.repartition(numPartitions, None)
return DataFrame(rdd, self.sql_ctx)

def sample(self, withReplacement, fraction, seed=None):
"""
Expand Down

0 comments on commit 257b9e6

Please sign in to comment.