mxm commented on code in PR #17618:
URL: https://github.com/apache/iceberg/pull/17618#discussion_r3775928204
##########
flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/DynamicRecordProcessor.java:
##########
@@ -233,8 +234,11 @@ public void close() {
*/
@VisibleForTesting
static boolean isForwardEligible(DynamicRecord data) {
+ Set<String> equalityFields = data.equalityFields();
+ // Checks identifier field ids directly rather than resolving equality
field names, which would
+ // allocate per record.
return data.distributionMode() == null
- && DynamicSinkUtil.resolveEqualityFieldNames(data.equalityFields(),
data.schema())
- .isEmpty();
+ && (equalityFields == null || equalityFields.isEmpty())
+ && data.schema().identifierFieldIds().isEmpty();
Review Comment:
Funny enough, `data.schema().identifierFieldIds()` also allocates a new
`Set`, so I don't think this is much better. Maybe this is slightly faster
because we avoid creating one more `Set`.
Could we add this optimization directly to `resolveEqualityFieldNames`?
--
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]