itholic commented on code in PR #46063:
URL: https://github.com/apache/spark/pull/46063#discussion_r1565663205


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/trees/origin.scala:
##########
@@ -76,6 +76,12 @@ object CurrentOrigin {
       value.get.copy(line = Some(line), startPosition = Some(start)))
   }
 
+  def setPySparkErrorContext(pysparkFragment: String, pysparkCallSite: 
String): Unit = {
+    val tupleInfo = (pysparkFragment, pysparkCallSite)
+    value.set(
+      value.get.copy(pysparkErrorContext = Some(tupleInfo)))
+  }
+

Review Comment:
   cc @HyukjinKwon @cloud-fan 
   
   Try reusing the existing `CurrentOrigin` here so we don't need to add 
separate ThreadLocal and also don't need to add helper functions for each 
existing methods.
   
   Some test cases are still need to be addressed, but I believe the overall 
structure is ready to review.



-- 
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]

Reply via email to