wuchong commented on a change in pull request #13763:
URL: https://github.com/apache/flink/pull/13763#discussion_r513140215



##########
File path: 
flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroSchemaConverter.java
##########
@@ -297,32 +300,53 @@ private static DataType convertToDataType(Schema schema) {
         * @return Avro's {@link Schema} matching this logical type.
         */
        public static Schema convertToSchema(LogicalType logicalType) {
+               // If it is parsing the root row type, switches from nullable 
true to false
+               // because a nullable row type is meaningless and would 
generate wrong schema.
+               if (logicalType.getTypeRoot() == LogicalTypeRoot.ROW

Review comment:
       I think we can make the parameter to be `RowType`, that would make sense 
to use it as the top-level row type and not generate nullable for it. Besides, 
would be better to add comments in the Javadoc. Currently, this method has the 
same Javadoc with `convertToSchema(LogicalType logicalType, String rowName)`. 




----------------------------------------------------------------
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


Reply via email to