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


##########
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:
   I guess we don't need changes here as `terminate` will be called in `func` 
now.



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