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/12/12 01:51:40 UTC

[GitHub] [spark] HeartSaVioR opened a new pull request #26855: [SPARK-30227][SQL] Add close() on DataWriter interface

HeartSaVioR opened a new pull request #26855: [SPARK-30227][SQL] Add close() on DataWriter interface
URL: https://github.com/apache/spark/pull/26855
 
 
   ### What changes were proposed in this pull request?
   
   This patch adds close() method to the DataWriter interface, which will become the place to cleanup the resource.
   
   ### Why are the changes needed?
   
   The lifecycle of DataWriter instance ends at either commit() or abort(). That makes datasource implementors to feel they can place resource cleanup in both sides, but abort() can be called when commit() fails; so they have to ensure they don't do double-cleanup if cleanup is not idempotent.
   
   ### Does this PR introduce any user-facing change?
   
   Depends on the definition of user; if they're developers of custom DSv2 source, they have to add close() in their DataWriter implementations. It's OK to just add close() with empty content as they should have already dealt with resource cleanup in commit/abort, but they would love to migrate the resource cleanup logic to close() as it avoids double cleanup.
   
   ### How was this patch tested?
   
   Existing tests.

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