Github user zsxwing commented on a diff in the pull request:
https://github.com/apache/spark/pull/13342#discussion_r66545305
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataFrameReaderWriterSuite.scala
---
@@ -572,4 +572,25 @@ class DataFrameReaderWriterSuite extends StreamTest
with BeforeAndAfter {
cq.awaitTermination(2000L)
}
+
+ test("foreach") {
+ import testImplicits._
+
+ val ds = spark.read
+ .format("org.apache.spark.sql.streaming.test")
+ .stream()
+ .as[Int]
+
+ val cq = ds.write
+ .format("console")
+ .option("checkpointLocation", newMetadataDir)
+ .trigger(ProcessingTime(2.seconds))
+ .foreach(new ForeachWriter[Int] {
+ override def open(partitionId: Long, version: Long): Boolean = true
+ override def process(value: Int): Unit = {}
+ override def close(errorOrNull: Throwable): Unit = {}
+ })
+
+ cq.awaitTermination(2000L)
--- End diff --
I'm going to remove this one as it should be covered in ForeachSinkSuite
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]