low-bee commented on code in PR #27499:
URL: https://github.com/apache/flink/pull/27499#discussion_r2753903180
##########
flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/AvroDeserializationSchema.java:
##########
@@ -174,8 +227,15 @@ public T deserialize(@Nullable byte[] message) throws
IOException {
inputStream.setBuffer(message);
Schema readerSchema = getReaderSchema();
GenericDatumReader<T> datumReader = getDatumReader();
-
- datumReader.setSchema(readerSchema);
+ if (isFastReaderEnabled()) {
+ // open fast read
+ Schema schema = datumReader.getSchema();
Review Comment:
The `setSchema` method in `AvroDeserializationSchema` will execute
`fastDatumReader = null;` Therefore, each piece of data will be reconstructed.
but the schemaString in AvroDeserializationSchema is final. Rebuilding is
unreasonable
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]