You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/11/25 05:31:13 UTC
[GitHub] [spark] cloud-fan commented on a diff in pull request #38742: [SPARK-41216][CONNECT][PYTHON] Implement `DataFrame.{isLocal, isStreaming, printSchema, inputFiles}`
cloud-fan commented on code in PR #38742:
URL: https://github.com/apache/spark/pull/38742#discussion_r1032016700
##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -822,6 +821,83 @@ def schema(self) -> StructType:
else:
return self._schema
+ @property
+ def isLocal(self) -> bool:
+ """Returns ``True`` if the :func:`collect` and :func:`take` methods can be run locally
+ (without any Spark executors).
+
+ .. versionadded:: 3.4.0
+
+ Returns
+ -------
+ bool
+ """
+ if self._plan is None:
+ raise Exception("Cannot analyze on empty plan.")
+ query = self._plan.to_proto(self._session)
+ return self._session._analyze(query).is_local
Review Comment:
are we going to cache the analyze result later?
--
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