You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by lw-lin <gi...@git.apache.org> on 2016/07/02 17:05:30 UTC

[GitHub] spark pull request #14030: [WIP][SPARK-16350][SQL] Fix `foreach` for streami...

GitHub user lw-lin opened a pull request:

    https://github.com/apache/spark/pull/14030

    [WIP][SPARK-16350][SQL] Fix `foreach` for streaming Dataset

    ## What changes were proposed in this pull request?
    
    - [x] add tests
    - [ ] fix `foreach`
    
    ## How was this patch tested?
    
    (Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
    
    
    (If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
    
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/lw-lin/spark fix-foreach-complete

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/14030.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #14030
    
----
commit f3f60f919a2070a6946d0d908b54225d3c2263fc
Author: Liwei Lin <lw...@gmail.com>
Date:   2016-07-02T14:56:06Z

    Add test(`complete`) & expand test(`append`)

----


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by lw-lin <gi...@git.apache.org>.
Github user lw-lin commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    Jenkins retest this please


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    Merged build finished. Test PASSed.


---
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


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

Posted by lw-lin <gi...@git.apache.org>.
Github user lw-lin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14030#discussion_r69855731
  
    --- 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 --
    
    fixed. @jaceklaskowski @zsxwing thanks!


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    **[Test build #61668 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61668/consoleFull)** for PR 14030 at commit [`2f8ba28`](https://github.com/apache/spark/commit/2f8ba2859c521979deacae87fa03460fec5c8191).


---
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


[GitHub] spark issue #14030: [WIP][SPARK-16350][SQL] Fix `foreach` for streaming Data...

Posted by lw-lin <gi...@git.apache.org>.
Github user lw-lin commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    Jenkins retest this please


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    Merged build finished. Test PASSed.


---
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


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

Posted by marmbrus <gi...@git.apache.org>.
Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14030#discussion_r69819131
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/ForeachSink.scala ---
    @@ -30,7 +32,42 @@ import org.apache.spark.sql.{DataFrame, Encoder, ForeachWriter}
     class ForeachSink[T : Encoder](writer: ForeachWriter[T]) extends Sink with Serializable {
     
       override def addBatch(batchId: Long, data: DataFrame): Unit = {
    -    data.as[T].foreachPartition { iter =>
    +    // TODO: Refine this method when SPARK-16264 is resolved; see comments below.
    --- End diff --
    
    Could we just use the QueryExecution of the dataframe that is passed in, instead of creating a new one?


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    Merged build finished. Test PASSed.


---
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


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

Posted by lw-lin <gi...@git.apache.org>.
Github user lw-lin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14030#discussion_r69855749
  
    --- 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)
    +      }
    +
    +      ForeachSinkSuite.clear()
    +
    +      // -- batch 1 ---------------------------------------
    +      input.addData(5, 6, 7, 8)
    +      query.processAllAvailable()
    +
    +      expectedEventsForPartition0 = Seq(
    +        ForeachSinkSuite.Open(partition = 0, version = 1),
    +        ForeachSinkSuite.Process(value = 5),
    +        ForeachSinkSuite.Process(value = 7),
    +        ForeachSinkSuite.Close(None)
    +      )
    +      expectedEventsForPartition1 = Seq(
    +        ForeachSinkSuite.Open(partition = 1, version = 1),
    +        ForeachSinkSuite.Process(value = 6),
    +        ForeachSinkSuite.Process(value = 8),
    +        ForeachSinkSuite.Close(None)
    +      )
    +
    +      allEvents = ForeachSinkSuite.allEvents()
           assert(allEvents.size === 2)
           assert {
             allEvents === Seq(expectedEventsForPartition0, expectedEventsForPartition1) ||
               allEvents === Seq(expectedEventsForPartition1, expectedEventsForPartition0)
           }
    +
    +      query.stop()
    +    }
    +  }
    +
    +  test("foreach() with `complete` output mode") {
    +    withTempDir { checkpointDir =>
    +      val input = MemoryStream[Int]
    +
    +      val query = input.toDS()
    +        .groupBy().count().as[Long].map(_.toInt)
    +        .writeStream
    +        .option("checkpointLocation", checkpointDir.getCanonicalPath)
    +        .outputMode("complete")
    --- End diff --
    
    fixed; thanks!


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    **[Test build #61666 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61666/consoleFull)** for PR 14030 at commit [`2f8ba28`](https://github.com/apache/spark/commit/2f8ba2859c521979deacae87fa03460fec5c8191).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    **[Test build #61668 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61668/consoleFull)** for PR 14030 at commit [`2f8ba28`](https://github.com/apache/spark/commit/2f8ba2859c521979deacae87fa03460fec5c8191).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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


[GitHub] spark issue #14030: [WIP][SPARK-16350][SQL] Fix `foreach` for streaming Data...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    **[Test build #61665 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61665/consoleFull)** for PR 14030 at commit [`02cb6b5`](https://github.com/apache/spark/commit/02cb6b5fd8f6877d86c3307654060316ea14f815).


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61666/
    Test FAILed.


---
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


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

Posted by marmbrus <gi...@git.apache.org>.
Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14030#discussion_r69819064
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala ---
    @@ -155,7 +155,7 @@ private[sql] object Dataset {
     class Dataset[T] private[sql](
         @transient val sparkSession: SparkSession,
         @DeveloperApi @transient val queryExecution: QueryExecution,
    -    encoder: Encoder[T])
    +    val encoder: Encoder[T])
    --- End diff --
    
    I'm not sure we want to make this publicly available.


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by lw-lin <gi...@git.apache.org>.
Github user lw-lin commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    Updated. @zsxwing could you take another look?


---
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


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

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/14030


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by zsxwing <gi...@git.apache.org>.
Github user zsxwing commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    @lw-lin thanks for fixing it. Just some minor comments. Once you fix it and tests pass, I will merge it.


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    **[Test build #61665 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61665/consoleFull)** for PR 14030 at commit [`02cb6b5`](https://github.com/apache/spark/commit/02cb6b5fd8f6877d86c3307654060316ea14f815).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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


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

Posted by jaceklaskowski <gi...@git.apache.org>.
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    **[Test build #61893 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61893/consoleFull)** for PR 14030 at commit [`85e2352`](https://github.com/apache/spark/commit/85e2352c3010ed311603acd5007c6b3e05c25056).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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


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

Posted by zsxwing <gi...@git.apache.org>.
Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14030#discussion_r69823441
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/ForeachSink.scala ---
    @@ -30,7 +32,42 @@ import org.apache.spark.sql.{DataFrame, Encoder, ForeachWriter}
     class ForeachSink[T : Encoder](writer: ForeachWriter[T]) extends Sink with Serializable {
     
       override def addBatch(batchId: Long, data: DataFrame): Unit = {
    -    data.as[T].foreachPartition { iter =>
    +    // TODO: Refine this method when SPARK-16264 is resolved; see comments below.
    +
    +    // This logic should've been as simple as:
    +    // ```
    +    //   data.as[T].foreachPartition { iter => ... }
    +    // ```
    +    //
    +    // Unfortunately, doing that would just break the incremental planing. The reason is,
    +    // `Dataset.foreachPartition()` would further call `Dataset.rdd()`, but `Dataset.rdd()` just
    +    // does not support `IncrementalExecution`.
    +    //
    +    // So as a provisional fix, below we've made a special version of `Dataset` with its `rdd()`
    +    // method supporting incremental planning. But in the long run, we should generally make newly
    +    // created Datasets use `IncrementalExecution` where necessary (which is SPARK-16264 tries to
    +    // resolve).
    +
    +    val dataAsT = data.as[T]
    +    val datasetWithIncrementalExecution =
    +      new Dataset(data.sparkSession, dataAsT.logicalPlan, dataAsT.encoder) {
    --- End diff --
    
    `dataAsT` can be removed. You can use `implicitly[Encoder[T]]` to get the encoder. Please also revert the change to Dataset.


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61668/
    Test PASSed.


---
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


[GitHub] spark issue #14030: [WIP][SPARK-16350][SQL] Fix `foreach` for streaming Data...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61659/
    Test PASSed.


---
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


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

Posted by lw-lin <gi...@git.apache.org>.
Github user lw-lin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14030#discussion_r69855694
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/ForeachSink.scala ---
    @@ -30,7 +32,42 @@ import org.apache.spark.sql.{DataFrame, Encoder, ForeachWriter}
     class ForeachSink[T : Encoder](writer: ForeachWriter[T]) extends Sink with Serializable {
     
       override def addBatch(batchId: Long, data: DataFrame): Unit = {
    -    data.as[T].foreachPartition { iter =>
    +    // TODO: Refine this method when SPARK-16264 is resolved; see comments below.
    +
    +    // This logic should've been as simple as:
    +    // ```
    +    //   data.as[T].foreachPartition { iter => ... }
    +    // ```
    +    //
    +    // Unfortunately, doing that would just break the incremental planing. The reason is,
    +    // `Dataset.foreachPartition()` would further call `Dataset.rdd()`, but `Dataset.rdd()` just
    +    // does not support `IncrementalExecution`.
    +    //
    +    // So as a provisional fix, below we've made a special version of `Dataset` with its `rdd()`
    +    // method supporting incremental planning. But in the long run, we should generally make newly
    +    // created Datasets use `IncrementalExecution` where necessary (which is SPARK-16264 tries to
    +    // resolve).
    +
    +    val dataAsT = data.as[T]
    +    val datasetWithIncrementalExecution =
    +      new Dataset(data.sparkSession, dataAsT.logicalPlan, dataAsT.encoder) {
    --- End diff --
    
    fixed; thanks!


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix `foreach` for streaming Dataset

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    **[Test build #61666 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61666/consoleFull)** for PR 14030 at commit [`2f8ba28`](https://github.com/apache/spark/commit/2f8ba2859c521979deacae87fa03460fec5c8191).


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by zsxwing <gi...@git.apache.org>.
Github user zsxwing commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    LGTM. Merging to master and 2.0.


---
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


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

Posted by zsxwing <gi...@git.apache.org>.
Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14030#discussion_r69824404
  
    --- 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 --
    
    yeah, or just `allEvents.toSet === Set(expectedEventsForPartition0, expectedEventsForPartition1)`


---
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


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

Posted by lw-lin <gi...@git.apache.org>.
Github user lw-lin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14030#discussion_r69856084
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/ForeachSink.scala ---
    @@ -30,7 +32,42 @@ import org.apache.spark.sql.{DataFrame, Encoder, ForeachWriter}
     class ForeachSink[T : Encoder](writer: ForeachWriter[T]) extends Sink with Serializable {
     
       override def addBatch(batchId: Long, data: DataFrame): Unit = {
    -    data.as[T].foreachPartition { iter =>
    +    // TODO: Refine this method when SPARK-16264 is resolved; see comments below.
    --- End diff --
    
    The logical plan of the created `IncrementalExecution` has to be `deserialized`[#L55](https://github.com/apache/spark/pull/14030/files#diff-98acda846a9dd63efc42e0957594e05dR55),
    so we should not re-use the `QueryExecution` passed in?


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61893/
    Test PASSed.


---
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


[GitHub] spark issue #14030: [WIP][SPARK-16350][SQL] Fix `foreach` for streaming Data...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    **[Test build #61659 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61659/consoleFull)** for PR 14030 at commit [`f3f60f9`](https://github.com/apache/spark/commit/f3f60f919a2070a6946d0d908b54225d3c2263fc).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by lw-lin <gi...@git.apache.org>.
Github user lw-lin commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    @zsxwing could you take a look at this? Thanks!


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by lw-lin <gi...@git.apache.org>.
Github user lw-lin commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    @zsxwing could you take a look at this when you have time? Thanks!


---
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


[GitHub] spark issue #14030: [WIP][SPARK-16350][SQL] Fix `foreach` for streaming Data...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    **[Test build #61659 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61659/consoleFull)** for PR 14030 at commit [`f3f60f9`](https://github.com/apache/spark/commit/f3f60f919a2070a6946d0d908b54225d3c2263fc).


---
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


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

Posted by lw-lin <gi...@git.apache.org>.
Github user lw-lin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14030#discussion_r69855673
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala ---
    @@ -155,7 +155,7 @@ private[sql] object Dataset {
     class Dataset[T] private[sql](
         @transient val sparkSession: SparkSession,
         @DeveloperApi @transient val queryExecution: QueryExecution,
    -    encoder: Encoder[T])
    +    val encoder: Encoder[T])
    --- End diff --
    
    this change had been reverted; thanks!


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61665/
    Test PASSed.


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    **[Test build #61893 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61893/consoleFull)** for PR 14030 at commit [`85e2352`](https://github.com/apache/spark/commit/85e2352c3010ed311603acd5007c6b3e05c25056).


---
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


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

Posted by jaceklaskowski <gi...@git.apache.org>.
Github user jaceklaskowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14030#discussion_r69382676
  
    --- 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)
    +      }
    +
    +      ForeachSinkSuite.clear()
    +
    +      // -- batch 1 ---------------------------------------
    +      input.addData(5, 6, 7, 8)
    +      query.processAllAvailable()
    +
    +      expectedEventsForPartition0 = Seq(
    +        ForeachSinkSuite.Open(partition = 0, version = 1),
    +        ForeachSinkSuite.Process(value = 5),
    +        ForeachSinkSuite.Process(value = 7),
    +        ForeachSinkSuite.Close(None)
    +      )
    +      expectedEventsForPartition1 = Seq(
    +        ForeachSinkSuite.Open(partition = 1, version = 1),
    +        ForeachSinkSuite.Process(value = 6),
    +        ForeachSinkSuite.Process(value = 8),
    +        ForeachSinkSuite.Close(None)
    +      )
    +
    +      allEvents = ForeachSinkSuite.allEvents()
           assert(allEvents.size === 2)
           assert {
             allEvents === Seq(expectedEventsForPartition0, expectedEventsForPartition1) ||
               allEvents === Seq(expectedEventsForPartition1, expectedEventsForPartition0)
           }
    +
    +      query.stop()
    +    }
    +  }
    +
    +  test("foreach() with `complete` output mode") {
    +    withTempDir { checkpointDir =>
    +      val input = MemoryStream[Int]
    +
    +      val query = input.toDS()
    +        .groupBy().count().as[Long].map(_.toInt)
    +        .writeStream
    +        .option("checkpointLocation", checkpointDir.getCanonicalPath)
    +        .outputMode("complete")
    --- End diff --
    
    Are really output modes strings? No enums or similar more type-safe values?


---
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


[GitHub] spark issue #14030: [SPARK-16350][SQL] Fix support for incremental planning ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    Merged build finished. Test FAILed.


---
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


[GitHub] spark issue #14030: [WIP][SPARK-16350][SQL] Fix `foreach` for streaming Data...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/14030
  
    Merged build finished. Test PASSed.


---
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


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

Posted by jaceklaskowski <gi...@git.apache.org>.
Github user jaceklaskowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14030#discussion_r69382669
  
    --- 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)
    +      }
    +
    +      ForeachSinkSuite.clear()
    +
    +      // -- batch 1 ---------------------------------------
    +      input.addData(5, 6, 7, 8)
    +      query.processAllAvailable()
    +
    +      expectedEventsForPartition0 = Seq(
    +        ForeachSinkSuite.Open(partition = 0, version = 1),
    +        ForeachSinkSuite.Process(value = 5),
    +        ForeachSinkSuite.Process(value = 7),
    +        ForeachSinkSuite.Close(None)
    +      )
    +      expectedEventsForPartition1 = Seq(
    +        ForeachSinkSuite.Open(partition = 1, version = 1),
    +        ForeachSinkSuite.Process(value = 6),
    +        ForeachSinkSuite.Process(value = 8),
    +        ForeachSinkSuite.Close(None)
    +      )
    +
    +      allEvents = ForeachSinkSuite.allEvents()
           assert(allEvents.size === 2)
           assert {
             allEvents === Seq(expectedEventsForPartition0, expectedEventsForPartition1) ||
               allEvents === Seq(expectedEventsForPartition1, expectedEventsForPartition0)
    --- End diff --
    
    Same as above


---
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