WweiL commented on code in PR #42779:
URL: https://github.com/apache/spark/pull/42779#discussion_r1317722427
##########
connector/connect/server/src/test/scala/org/apache/spark/sql/connect/service/SparkConnectSessionHodlerSuite.scala:
##########
@@ -79,4 +90,135 @@ class SparkConnectSessionHolderSuite extends
SharedSparkSession {
sessionHolder.getDataFrameOrThrow(key1)
}
}
+
+ private def dummyPythonFunction(sessionHolder: SessionHolder):
SimplePythonFunction = {
+ // Needed because pythonPath in PythonWorkerFactory doesn't include test
spark home
+ val sparkPythonPath = PythonUtils.mergePythonPaths(
+ Seq(sparkHome, "python", "lib", "pyspark.zip").mkString(File.separator),
+ Seq(sparkHome, "python", "lib",
PythonUtils.PY4J_ZIP_NAME).mkString(File.separator))
+
+ SimplePythonFunction(
+ command = Array.emptyByteArray,
+ envVars = mutable.Map("PYTHONPATH" -> sparkPythonPath).asJava,
+ pythonIncludes =
sessionHolder.artifactManager.getSparkConnectPythonIncludes.asJava,
+ pythonExec = IntegratedUDFTestUtils.pythonExec,
+ pythonVer = IntegratedUDFTestUtils.pythonVer,
+ broadcastVars = Lists.newArrayList(),
+ accumulator = null)
+ }
+
+ test("python foreachBatch process: process terminates after query is
stopped") {
+ val sessionHolder = SessionHolder.forTesting(spark)
Review Comment:
Found out a new way of testing this. Please see the update
--
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]