From 7c6bedff252b3ccdb2de74fff438d2eafb489d9b Mon Sep 17 00:00:00 2001 From: luokey <854194341@qq.com> Date: Mon, 20 Jun 2022 15:41:23 +0800 Subject: [PATCH] [HUDI-4259] Flink create avro schema not conformance to standards (#5878) * flink create avro schema not conformance to standards Co-authored-by: 854194341@qq.com --- .../main/java/org/apache/hudi/util/AvroSchemaConverter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/util/AvroSchemaConverter.java b/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/util/AvroSchemaConverter.java index 9a33df3a4..73c734178 100644 --- a/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/util/AvroSchemaConverter.java +++ b/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/util/AvroSchemaConverter.java @@ -171,7 +171,7 @@ public class AvroSchemaConverter { /** * Converts Flink SQL {@link LogicalType} (can be nested) into an Avro schema. * - *

The "{rowName}_" is used as the nested row type name prefix in order to generate the right + *

The "{rowName}." is used as the nested row type name prefix in order to generate the right * schema. Nested record type that only differs with type name is still compatible. * * @param logicalType logical type @@ -263,7 +263,7 @@ public class AvroSchemaConverter { LogicalType fieldType = rowType.getTypeAt(i); SchemaBuilder.GenericDefault fieldBuilder = builder.name(fieldName) - .type(convertToSchema(fieldType, rowName + "_" + fieldName)); + .type(convertToSchema(fieldType, rowName + "." + fieldName)); if (fieldType.isNullable()) { builder = fieldBuilder.withDefault(null);