Ngone51 commented on pull request #33556:
URL: https://github.com/apache/spark/pull/33556#issuecomment-891567046
>I mean closeResources() will set initialized as false and initialized is
always false in finally block, so will "just avoid file >operations when
initialized=false in revertPartialWritesAndClose" become "always not do these
file operations" ?
>
>Utils.tryWithSafeFinally {
if (initialized) {
writeMetrics.decBytesWritten(reportedPosition - committedPosition)
writeMetrics.decRecordsWritten(numRecordsWritten)
streamOpen = false
closeResources() // `closeResources()` will set `initialized` as
false
}
} {
// `initialized` is always false in this block
// do truncate file operations.
}
You're right...I was thinking about the case where there's no data at all..
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]