You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/08/19 22:43:03 UTC

[GitHub] [spark] zsxwing commented on a change in pull request #25407: [SPARK-28650][SS][DOC] Correct explanation of guarantee for ForeachWriter

zsxwing commented on a change in pull request #25407: [SPARK-28650][SS][DOC] Correct explanation of guarantee for ForeachWriter
URL: https://github.com/apache/spark/pull/25407#discussion_r315442328
 
 

 ##########
 File path: docs/structured-streaming-programming-guide.md
 ##########
 @@ -2251,13 +2251,10 @@ When the streaming query is started, Spark calls the function or the object’s
 
 - The close() method (if it exists) is called if an open() method exists and returns successfully (irrespective of the return value), except if the JVM or Python process crashes in the middle.
 
-- **Note:** The partitionId and epochId in the open() method can be used to deduplicate generated data 
-  when failures cause reprocessing of some input data. This depends on the execution mode of the query. 
-  If the streaming query is being executed in the micro-batch mode, then every partition represented 
-  by a unique tuple (partition_id, epoch_id) is guaranteed to have the same data. 
-  Hence, (partition_id, epoch_id) can be used to deduplicate and/or transactionally commit 
-  data and achieve exactly-once guarantees. However, if the streaming query is being executed 
-  in the continuous mode, then this guarantee does not hold and therefore should not be used for deduplication.
+- **Note:** Spark does not guarantee same output for (partitionId, epochId) on failure, so deduplication
 
 Review comment:
   nit: remove `on failure`. If a user stops a query, we may re-run a batch. I would not call this case as a failure. In addition, I think we can suggest users to use `foreachBatch` here if they needs deduplication.
   
   <img width="878" alt="Screen Shot 2019-08-19 at 3 40 04 PM" src="https://user-images.githubusercontent.com/1000778/63304392-b12edf00-c297-11e9-8e9c-7bd383888cc6.png">
   
   We should also update the above table from `exactly-once` to `at-least-once`. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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