HyukjinKwon commented on code in PR #41316:
URL: https://github.com/apache/spark/pull/41316#discussion_r1220858638


##########
python/pyspark/worker.py:
##########
@@ -871,6 +941,16 @@ def process():
         else:
             process()
 
+        if eval_type == PythonEvalType.SQL_TABLE_UDF:
+            assert udtf is not None
+            # Terminate the UDTF handler.
+            if hasattr(udtf, "terminate"):
+                try:
+                    # TODO: allow terminate to yield more rows.
+                    udtf.terminate()
+                except BaseException as e:
+                    raise RuntimeError(f"Failed to terminate UDTF: {str(e)}") 
from None

Review Comment:
   Why do we throw an exception `from None`? I believe the exceptions will be 
shown probably by exception chaining.



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