V1ncentzzZ commented on a change in pull request #13763: URL: https://github.com/apache/flink/pull/13763#discussion_r510774044
########## File path: flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroSchemaConverter.java ########## @@ -362,7 +369,11 @@ public static Schema convertToSchema(LogicalType logicalType, String rowName) { .record(rowName) .fields(); for (int i = 0; i < rowType.getFieldCount(); i++) { - String fieldName = rowName + "_" + fieldNames.get(i); + String fieldName = fieldNames.get(i); + if (rowName.equals(fieldName)) { + // Can not build schema when the record and field have the same name + fieldName = rowName + "_" + fieldName; + } Review comment: I think there is still existed a bug. see: https://issues.apache.org/jira/browse/FLINK-19779?focusedCommentId=17219588&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17219588 ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org