low-bee commented on code in PR #27499:
URL: https://github.com/apache/flink/pull/27499#discussion_r2753586799
##########
flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/AvroDeserializationSchema.java:
##########
@@ -188,7 +248,17 @@ void checkAvroInitialized() throws IOException {
if (datumReader != null) {
return;
}
-
+ synchronized (this) {
+ if (isFastReaderEnabled()) {
+ String openFlag = System.getProperty(FAST_READER_PROP);
+ if (StringUtils.isEmpty(openFlag)) {
+ System.setProperty(FAST_READER_PROP, "true");
+ LOG.info(
+ "{} are enabled, but FAST_READER_PROP is empty. We
just change it to true.",
Review Comment:
I'm a junior developer, and this is my thought process. Please let me know
if there are any issues.
Prior to Avro 1.12.1, the default value of `FAST_READER_PROP` was false. To
enable this feature, users typically needed to set the environment variable
`env.java.opts.all=-Dorg.apache.avro.fastread=true`. However, since users have
configured the Flink parameter `open.fastread=true`, I want to simplify this
process.
--
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]