ueshin commented on code in PR #46063:
URL: https://github.com/apache/spark/pull/46063#discussion_r1567889537
##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/trees/QueryContexts.scala:
##########
@@ -160,6 +160,8 @@ case class DataFrameQueryContext(
val pysparkFragment: String = pysparkErrorContext.map(_._1).getOrElse("")
val pysparkCallSite: String = pysparkErrorContext.map(_._2).getOrElse("")
+ PySparkCurrentOrigin.clear()
Review Comment:
If we clear `PySparkCurrentOrigin` right after `get`, seems like `lit` here:
https://github.com/apache/spark/blob/ccb87fb26481acecbd75682ddc8fa9e5dd52e8cb/sql/core/src/main/scala/org/apache/spark/sql/Column.scala#L171
consumes the PySpark context in this case. We may want to clear it after we
call the JVM method.
```py
_capture_call_site(func.__name__)
try:
return func(*args, **kwargs)
finally:
pyspark_origin.clean()
```
--
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]