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

    https://github.com/apache/nifi/pull/2245#discussion_r157261143
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/csv/JacksonCSVRecordReader.java
 ---
    @@ -136,7 +134,7 @@ public Record nextRecord(final boolean coerceTypes, 
final boolean dropUnknownFie
     
                 // If the first record is the header names (and we're using 
them), store those off for use in creating the value map on the next iterations
                 if (rawFieldNames == null) {
    -                if (hasHeader && ignoreHeader) {
    +                if (!hasHeader || ignoreHeader) {
                         rawFieldNames = schema.getFieldNames();
                     } else {
                         rawFieldNames = Arrays.stream(csvRecord).map((a) -> {
    --- End diff --
    
    I'm not sure that I understand the logic here... was this perhaps due to 
some refactoring and got overlooked, or is this actually doing something that's 
just not obvious to me? Seems this could just be done as 
`Arrays.asList(csvRecord)`


---

Reply via email to