chaoqin-li1123 commented on code in PR #46651:
URL: https://github.com/apache/spark/pull/46651#discussion_r1606249464
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/python/PythonStreamingDataSourceSuite.scala:
##########
@@ -763,6 +799,36 @@ class PythonStreamingDataSourceSuite extends
PythonDataSourceSuiteBase {
}
}
+ // Verify that commit runner work correctly with large timeout interval.
+ test(s"data source stream write, trigger interval=20 seconds") {
+ assume(shouldTestPandasUDFs)
+ val dataSource =
+ createUserDefinedPythonDataSource(dataSourceName,
simpleDataStreamWriterScript)
+ spark.dataSource.registerPython(dataSourceName, dataSource)
+ val inputData = MemoryStream[Int](numPartitions = 3)
+ val df = inputData.toDF()
+ withTempDir { dir =>
+ val path = dir.getAbsolutePath
+ val checkpointDir = new File(path, "checkpoint")
+ checkpointDir.mkdir()
+ val outputDir = new File(path, "output")
+ outputDir.mkdir()
+ val q = df
+ .writeStream
+ .format(dataSourceName)
+ .option("checkpointLocation", checkpointDir.getAbsolutePath)
+ .trigger(ProcessingTimeTrigger(20 * 1000))
+ .start(outputDir.getAbsolutePath)
+ eventually(timeout(waitTimeout * 5)) {
+ inputData.addData(1 to 3)
Review Comment:
A batch in memory stream actually doesn't correspond to a
microbatch(https://github.com/apache/spark/blob/88eb9ebe8524676631c6a4a6cfaf9172acd23818/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/memory.scala#L231),
but I figure out a way to do something similar.
--
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]