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/06/05 04:49:00 UTC

[GitHub] [flink] godfreyhe commented on a change in pull request #12471: [FLINK-18073][FLINK-18029][avro] Fix AvroRowDataSerializationSchema is not serializable and add IT cases

godfreyhe commented on a change in pull request #12471:
URL: https://github.com/apache/flink/pull/12471#discussion_r435687446



##########
File path: flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroSchemaConverter.java
##########
@@ -254,14 +254,6 @@ public static Schema convertToSchema(LogicalType logicalType, int rowTypeCounter
 					.array()
 					.items(convertToSchema(arrayType.getElementType(), rowTypeCounter));
 			case RAW:

Review comment:
       ditto

##########
File path: flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/AvroRowSerializationSchema.java
##########
@@ -242,14 +245,20 @@ private Object convertFlinkType(Schema schema, Object object) {
 				// check for logical types
 				if (object instanceof Date) {
 					return convertFromDate(schema, (Date) object);
+				} else if (object instanceof LocalDate) {
+					return convertFromDate(schema, Date.valueOf((LocalDate) object));
 				} else if (object instanceof Time) {
 					return convertFromTime(schema, (Time) object);
+				} else if (object instanceof LocalTime) {

Review comment:
       is there any new test to check the fix ?




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