Github user MLnick commented on a diff in the pull request:
https://github.com/apache/spark/pull/13780#discussion_r73519433
--- Diff: python/pyspark/sql/dataframe.py ---
@@ -376,24 +376,47 @@ def foreachPartition(self, f):
@since(1.3)
def cache(self):
- """ Persists with the default storage level (C{MEMORY_ONLY}).
+ """Persists the :class:`DataFrame` with the default storage level
(C{MEMORY_AND_DISK}).
+
+ .. note:: the default storage level has changed to
C{MEMORY_AND_DISK} to match Scala in 2.0.
"""
self.is_cached = True
self._jdf.cache()
return self
@since(1.3)
- def persist(self, storageLevel=StorageLevel.MEMORY_ONLY):
- """Sets the storage level to persist its values across operations
- after the first time it is computed. This can only be used to
assign
- a new storage level if the RDD does not have a storage level set
yet.
- If no storage level is specified defaults to (C{MEMORY_ONLY}).
+ def persist(self, storageLevel=StorageLevel.MEMORY_AND_DISK):
--- End diff --
Yes, this is true. The issue is that the deser versions were deprecated in
#10092 and made to equal the ser versions, and so can't actually be specified
in Python any more. Hence we have a discrepancy now between Python RDDs (always
stored ser) and DataFrames (stored deser in tungsten/spark sql binary format by
default, but it is possible to store ser though AFAIK that will always be
non-optimal so should certainly be discouraged).
cc @gatorsmile @davies @rxin
---
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]