wgtmac commented on code in PR #35520:
URL: https://github.com/apache/arrow/pull/35520#discussion_r1189477737


##########
cpp/src/parquet/file_writer.cc:
##########
@@ -219,17 +219,17 @@ class RowGroupSerializer : public 
RowGroupWriter::Contents {
       closed_ = true;
       CheckRowsWritten();
 
-      for (size_t i = 0; i < column_writers_.size(); i++) {
-        if (column_writers_[i]) {
-          total_bytes_written_ += column_writers_[i]->Close();
+      // If ColumnWriter::Close thrown an exception, avoid
+      // have bad states in column_writers_.

Review Comment:
   ```suggestion
         // Avoid invalid state if ColumnWriter::Close() throws internally.
   ```



##########
cpp/src/parquet/file_writer.cc:
##########
@@ -219,17 +219,17 @@ class RowGroupSerializer : public 
RowGroupWriter::Contents {
       closed_ = true;
       CheckRowsWritten();
 
-      for (size_t i = 0; i < column_writers_.size(); i++) {
-        if (column_writers_[i]) {
-          total_bytes_written_ += column_writers_[i]->Close();
+      // If ColumnWriter::Close thrown an exception, avoid
+      // have bad states in column_writers_.

Review Comment:
   If anything wrong happens here, should we let the FileSerializer know that 
it cannot accept any write any more?



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

Reply via email to