Github user pvillard31 commented on the issue:

    https://github.com/apache/nifi/pull/2966
  
    Hey @markap14 - thanks for the review. You're right, it's much better to 
address it when creating the Avro schema. That would prevent this error to 
happen again if one day we add a Reader for a format that would accept non Avro 
compatible field names.
    
    Just a quick remark. Initially in ``AvroTypeUtil`` I just wanted to change 
L123 from:
    ````java
    final Field field = new Field(recordField.getFieldName(), schema, null, 
recordField.getDefaultValue());
    ````
    to
    ````java
    final Field field = new 
Field(normalizeNameForAvro(recordField.getFieldName()), schema, null, 
recordField.getDefaultValue());
    ````
    
    But not sure changing the name just here is really a good idea and if it's 
not going to break some things in other places. In the end, I changed all the 
occurrences of ``recordField.getFieldName()`` to normalize the name. Thoughts?


---

Reply via email to