link3280 opened a new pull request #12454:
URL: https://github.com/apache/flink/pull/12454
## What is the purpose of the change
AvroRow(De)SerializationSchema doesn't know how to convert the new physical
classes of Timestamp (eg. java.time.Date) to/from Avro's int/long based
timestamp. Currently, when encountering objects of the new physical classes,
AvroRow(De)SerializationSchema just ignores them and passes them to Avro's
GenericDatumWriter/Reader, which leads to ClassCastException thrown by
GenericDatumWriter/Reader. See AvroRowSerializationSchema.
To fix this problem, we should support LocalTime/LocalDate/LocalDateTime
conversion to int/long in AvroRowSerializationSchema, and support int/long
conversion to LocalTime/LocalDate/LocalDateTime based on logical
types(Types.LOCAL_TIME/Types.LOCAL_DATE/Types.LOCAL_DATE_TIME) in
AvroRowDeserializationSchema.
*Note that a new AvroRowDataDeserializationSchema has been introduced, and
AvroRow(De)SerializationSchema might be deprecated in the future. But it's
still worth to be fixed on 1.10 or maybe the upcoming 1.11.x if it's not yet
deprecated.*
## Brief change log
*Add numeric type(int/long) timestamp to/from the new timestamp conversion
classes(LocalDateTime/LocalTime/LocalDate) in AvroRow(De)SerializationSchema.*
## Verifying this change
*(Please pick either of the following options)*
This change is a trivial rework / code cleanup without any test coverage.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: yes
- The serializers: don't know
- The runtime per-record code paths (performance sensitive): yes
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? (not applicable / docs / JavaDocs
/ not documented)
----------------------------------------------------------------
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:
[email protected]