This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new c4590b6  [SPARK-32836][SS][TESTS] Fix DataStreamReaderWriterSuite to 
check writer options correctly
c4590b6 is described below

commit c4590b6167dcbb8849c32a1045bf415666cfc1ae
Author: Dongjoon Hyun <dongj...@apache.org>
AuthorDate: Wed Sep 9 19:46:55 2020 -0700

    [SPARK-32836][SS][TESTS] Fix DataStreamReaderWriterSuite to check writer 
options correctly
    
    ### What changes were proposed in this pull request?
    
    This PR aims to fix the test coverage at `DataStreamReaderWriterSuite`.
    
    ### Why are the changes needed?
    
    Currently, the test case checks `DataStreamReader` options instead of 
`DataStreamWriter` options.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Pass the revised test case.
    
    Closes #29701 from dongjoon-hyun/SPARK-32836.
    
    Authored-by: Dongjoon Hyun <dongj...@apache.org>
    Signed-off-by: Dongjoon Hyun <dongj...@apache.org>
    (cherry picked from commit 06a994517fc3080b14f01183eeb17e56ab52eaa8)
    Signed-off-by: Dongjoon Hyun <dongj...@apache.org>
---
 .../sql/streaming/test/DataStreamReaderWriterSuite.scala   | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git 
a/sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataStreamReaderWriterSuite.scala
 
b/sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataStreamReaderWriterSuite.scala
index 569114a..297a7cc 100644
--- 
a/sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataStreamReaderWriterSuite.scala
+++ 
b/sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataStreamReaderWriterSuite.scala
@@ -171,18 +171,20 @@ class DataStreamReaderWriterSuite extends StreamTest with 
BeforeAndAfter {
 
     LastOptions.clear()
 
-    df.writeStream
+    val query = df.writeStream
       .format("org.apache.spark.sql.streaming.test")
-      .option("opt1", "1")
-      .options(Map("opt2" -> "2"))
+      .option("opt1", "5")
+      .options(Map("opt2" -> "4"))
       .options(map)
       .option("checkpointLocation", newMetadataDir)
       .start()
-      .stop()
 
-    assert(LastOptions.parameters("opt1") == "1")
-    assert(LastOptions.parameters("opt2") == "2")
+    assert(LastOptions.parameters("opt1") == "5")
+    assert(LastOptions.parameters("opt2") == "4")
     assert(LastOptions.parameters("opt3") == "3")
+    assert(LastOptions.parameters.contains("checkpointLocation"))
+
+    query.stop()
   }
 
   test("partitioning") {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to