You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by jaceklaskowski <gi...@git.apache.org> on 2016/07/02 21:00:06 UTC

[GitHub] spark pull request #14030: [SPARK-16350][SQL] Fix support for incremental pl...

Github user jaceklaskowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14030#discussion_r69382667
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/ForeachSinkSuite.scala ---
    @@ -35,35 +35,109 @@ class ForeachSinkSuite extends StreamTest with SharedSQLContext with BeforeAndAf
         sqlContext.streams.active.foreach(_.stop())
       }
     
    -  test("foreach") {
    +  test("foreach() with `append` output mode") {
         withTempDir { checkpointDir =>
           val input = MemoryStream[Int]
           val query = input.toDS().repartition(2).writeStream
             .option("checkpointLocation", checkpointDir.getCanonicalPath)
    +        .outputMode("append")
             .foreach(new TestForeachWriter())
             .start()
    +
    +      // -- batch 0 ---------------------------------------
           input.addData(1, 2, 3, 4)
           query.processAllAvailable()
     
    -      val expectedEventsForPartition0 = Seq(
    +      var expectedEventsForPartition0 = Seq(
             ForeachSinkSuite.Open(partition = 0, version = 0),
             ForeachSinkSuite.Process(value = 1),
             ForeachSinkSuite.Process(value = 3),
             ForeachSinkSuite.Close(None)
           )
    -      val expectedEventsForPartition1 = Seq(
    +      var expectedEventsForPartition1 = Seq(
             ForeachSinkSuite.Open(partition = 1, version = 0),
             ForeachSinkSuite.Process(value = 2),
             ForeachSinkSuite.Process(value = 4),
             ForeachSinkSuite.Close(None)
           )
     
    -      val allEvents = ForeachSinkSuite.allEvents()
    +      var allEvents = ForeachSinkSuite.allEvents()
    +      assert(allEvents.size === 2)
    +      assert {
    +        allEvents === Seq(expectedEventsForPartition0, expectedEventsForPartition1) ||
    +          allEvents === Seq(expectedEventsForPartition1, expectedEventsForPartition0)
    --- End diff --
    
    `should contain theSameElementsAs`? See http://www.scalatest.org/user_guide/using_matchers#workingWithAggregations


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org