damondouglas commented on code in PR #25420:
URL: https://github.com/apache/beam/pull/25420#discussion_r1102292885


##########
sdks/java/io/csv/src/main/java/org/apache/beam/sdk/io/csv/CsvIO.java:
##########
@@ -439,12 +475,16 @@ private static TextIO.Write 
writeWithCSVFormatHeaderAndComments(
         }
       }
 
-      CSVFormat withoutHeaderComments = csvFormat.withHeaderComments();
+      // We remove header comments since we've already processed them above.
+      // CSV commons library was designed with a single file write in mind
+      // which is why we need to manipulate CSVFormat in this way to be 
compatible
+      // in a TextIO.Write context.
+      CSVFormat withHeaderCommentsRemoved = csvFormat.withHeaderComments();
 
       result.add(
-          withoutHeaderComments
+          withHeaderCommentsRemoved
               // The withSkipHeaderRecord parameter prevents CSVFormat from 
outputting two copies of
-              // the header.
+              // the header; we already

Review Comment:
   TODO: @damondouglas Fix typo when checks finalize



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