ueshin commented on code in PR #43635:
URL: https://github.com/apache/spark/pull/43635#discussion_r1380579484
##########
python/pyspark/sql/tests/test_udf.py:
##########
@@ -1020,6 +1022,15 @@ def test_udf(a):
with self.assertRaisesRegex(PythonException, "StopIteration"):
self.spark.range(10).select(test_udf(col("id"))).show()
+ def test_python_udf_segfault(self):
+ with
self.sql_conf({"spark.sql.execution.pyspark.udf.faulthandler.enabled": True}):
+ try:
+ import ctypes
+
+ self.spark.range(1).select(udf(lambda x:
ctypes.string_at(0))("id")).collect()
+ except Exception as e:
+ self.assertRegex(str(e), "Segmentation fault")
Review Comment:
nit: wondering if we can use `with self.assertRaisesRegex( ... )` here?
--
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]