You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "grundprinzip (via GitHub)" <gi...@apache.org> on 2023/05/31 09:02:02 UTC

[GitHub] [spark] grundprinzip commented on a diff in pull request #41399: [SPARK-43894][PYTHON] Fix bug in df.cache()

grundprinzip commented on code in PR #41399:
URL: https://github.com/apache/spark/pull/41399#discussion_r1211329867


##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -1826,9 +1826,7 @@ def rdd(self, *args: Any, **kwargs: Any) -> None:
     def cache(self) -> "DataFrame":
         if self._plan is None:
             raise Exception("Cannot cache on empty plan.")
-        relation = self._plan.plan(self._session.client)
-        self._session.client._analyze(method="persist", relation=relation)
-        return self
+        return self.persist(storageLevel=StorageLevel.MEMORY_AND_DISK)

Review Comment:
   This is the default StorageLevel - https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala#L91



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org