kinolaev commented on code in PR #18541:
URL: https://github.com/apache/iceberg/pull/18541#discussion_r4302374575
##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/TableMetadataCache.java:
##########
@@ -197,6 +197,17 @@ private ResolvedSchemaInfo schema(
}
Review Comment:
I agree, the method complexity was definitely an issue. I extracted the
`for` loop into its own method as you suggested, with one tweak: it returns
`null` when a refresh is needed.
This allows us to avoid calling `FlinkSchemaUtil.convert` when we don't need
`ResolvedSchemaInfo` for a compatible schema. The new method neither mutates
state nor calls `schema()`. The existing behavior is fully preserved aside from
the intended 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]