Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/incubator-flink/pull/201#discussion_r20567213
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/api/common/io/GenericCsvInputFormat.java
 ---
    @@ -269,6 +281,23 @@ public void open(FileInputSplit split) throws 
IOException {
        
        protected boolean parseRecord(Object[] holders, byte[] bytes, int 
offset, int numBytes) throws ParseException {
                
    +           if(commentStart != null) {
    +                   //check record for comments
    +                   String s = new String(bytes, offset, numBytes).trim();
    +                   int commentStartIndex = s.indexOf(commentStart);
    +                   
    +                   //delete record if the whole line was a comment
    +                   if(commentStartIndex == 0) {
    +                           return false;
    +                   }
    +                   //delete comment at the end of a valid record
    +                   if(commentStartIndex != -1) {
    +                           numBytes = numBytes - commentStartIndex + 1;
    +                   }
    +           }
    +           
    +           Logger LOG = 
LoggerFactory.getLogger(GenericCsvInputFormat.class);
    --- End diff --
    
    It is better to initialize the logger once statically per class


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to