kinolaev commented on code in PR #18541:
URL: https://github.com/apache/iceberg/pull/18541#discussion_r4295927517
##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/TableMetadataCache.java:
##########
@@ -151,7 +151,7 @@ private ResolvedSchemaInfo schema(
// and a new schema. Performance is paramount as this code is on the hot
path. Every other
// way for comparing 2 schemas were performing worse than the
// {@link CompareByNameVisitor#visit(Schema, Schema, boolean)}, so
caching was useless.
- ResolvedSchemaInfo lastResult = cached.inputSchemas.get(input);
+ ResolvedSchemaInfo lastResult = cachedSchema(identifier, cached, input,
allowRefresh);
if (lastResult != null) {
Review Comment:
Both options work, but they raise the cyclomatic complexity to 14, exceeding
the limit of 12 and causing `./gradlew
:iceberg-flink:iceberg-flink-2.3:checkstyleMain` to fail. That is why I added
the `cachedSchema` helper.
--
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]