Github user davies commented on a diff in the pull request:
https://github.com/apache/spark/pull/9504#discussion_r44075748
--- Diff: python/pyspark/sql/dataframe.py ---
@@ -590,6 +633,29 @@ def join(self, other, on=None, how=None):
return DataFrame(jdf, self.sql_ctx)
@ignore_unicode_prefix
+ @since(1.6)
+ def sortWithinPartitions(self, *cols, **kwargs):
+ """Returns a new :class:`DataFrame` with each partition sorted by
the specified column(s).
+
+ :param cols: list of :class:`Column` or column names to sort by.
+ :param ascending: boolean or list of boolean (default True).
+ Sort ascending vs. descending. Specify list for multiple sort
orders.
+ If a list is specified, length of the list must equal length
of the `cols`.
+
+ >>> df.rdd.getNumPartitions()
+ 4
--- End diff --
This may be determined by the number of CPU that the host have, is not
stable.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]