HyukjinKwon commented on code in PR #38891:
URL: https://github.com/apache/spark/pull/38891#discussion_r1039073594
##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -1554,6 +1554,52 @@ def explain(
"""
print(self._explain_string(extended=extended, mode=mode))
+ def createTempView(self, name: str) -> None:
+ """Creates a local temporary view with this :class:`DataFrame`.
+
+ The lifetime of this temporary table is tied to the
:class:`SparkSession`
+ that was used to create this :class:`DataFrame`.
+ throws :class:`TempTableAlreadyExistsException`, if the view name
already exists in the
+ catalog.
+
+ .. versionadded:: 3.4.0
+
+ Parameters
+ ----------
+ name : str
+ Name of the view.
+
+ Returns
+ -------
+ None
+ """
Review Comment:
```suggestion
"""
```
##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -1554,6 +1554,52 @@ def explain(
"""
print(self._explain_string(extended=extended, mode=mode))
+ def createTempView(self, name: str) -> None:
+ """Creates a local temporary view with this :class:`DataFrame`.
+
+ The lifetime of this temporary table is tied to the
:class:`SparkSession`
+ that was used to create this :class:`DataFrame`.
+ throws :class:`TempTableAlreadyExistsException`, if the view name
already exists in the
+ catalog.
+
+ .. versionadded:: 3.4.0
+
+ Parameters
+ ----------
+ name : str
+ Name of the view.
+
+ Returns
+ -------
+ None
+ """
+ command = plan.CreateView(
+ child=self._plan, name=name, is_global=False, replace=False
+ ).command(session=self._session.client)
+ self._session.client.execute_command(command)
+
+ def createOrReplaceTempView(self, name: str) -> None:
+ """Creates or replaces a local temporary view with this
:class:`DataFrame`.
+
+ The lifetime of this temporary table is tied to the
:class:`SparkSession`
+ that was used to create this :class:`DataFrame`.
+
+ .. versionadded:: 3.4.0
+
+ Parameters
+ ----------
+ name : str
+ Name of the view.
+
+ Returns
+ -------
+ None
Review Comment:
```suggestion
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]