gaborgsomogyi commented on a change in pull request #24382: [SPARK-27330][SS] 
support task abort in foreach writer
URL: https://github.com/apache/spark/pull/24382#discussion_r277987666
 
 

 ##########
 File path: docs/structured-streaming-programming-guide.md
 ##########
 @@ -2145,6 +2145,10 @@ streamingDatasetOfString.writeStream.foreach(
     def close(errorOrNull: Throwable): Unit = {
       // Close the connection
     }
+
+    def abort(): Unit = {
+      // Close the connection, this method is optional
 
 Review comment:
   > i don't think we should call close twice on each error (each with 
different exception), so my suggestion is to call close with generic exception 
only if close wasn't called yet
   
   Since `WriteToDataSourceV2Exec` has only one `catchBlock` and no retry we're 
aiming to call `abort` once, isn't it? Don't really know what kind of further 
logic you would like to add.
   Are you aiming to define `close will be called exactly-once` in the doc?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to