You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/10/23 09:59:36 UTC

[GitHub] [flink] V1ncentzzZ commented on a change in pull request #13763: [FLINK-19779][avro] Remove the record_ field name prefix for Confluen…

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:
users@infra.apache.org