zhengruifeng commented on code in PR #46007:
URL: https://github.com/apache/spark/pull/46007#discussion_r1561867006
##########
python/pyspark/sql/session.py:
##########
@@ -1630,6 +1630,13 @@ def sql(
-------
:class:`DataFrame`
+ Notes
+ -----
+ In Classic Spark, a referenced temporary view is resolved immediately,
while in Spark
+ Connect it is lazy evaluated.
+ So in Spark Connect if a view is dropped, modified or replaced after
`spark.sql`, the
+ execution may fail or generate different results.
Review Comment:
drop the view, for example
```
df = ...
df.createTempView("some_view")
df2 = spark.sql("SELECT * FROM some_view")
spark.catalog.dropTempView("some_view") <- drop the view
df2.show() <- should fail in Spark Connect
```
--
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]