twalthr commented on code in PR #27508:
URL: https://github.com/apache/flink/pull/27508#discussion_r2842078280


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/keyselector/AttributeBasedJoinKeyExtractor.java:
##########
@@ -288,11 +311,13 @@ private RowData buildKeyRowFromJoinedRow(
         for (int i = 0; i < keyExtractors.size(); i++) {
             keyRow.setField(i, 
keyExtractors.get(i).getLeftSideKey(joinedRowData));
         }
-        return keyRow;
+        return keySerializer.toBinaryRow(keyRow).copy();

Review Comment:
   Copies should be avoided whenever possible for performance reasons. We could 
think about using information about the underlying state backend and decide 
whether a copy is needed or not.
   Please take a look at e.g. [this 
PR](https://github.com/dawidwys/flink/blob/7d7d9f99113fd7e4f4be9c25c0f2cd4ed4b30581/flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/sink/WatermarkCompactingSinkMaterializer.java#L264)
 which uses the state backend identifer. We can check for `rocksdb` and 
otherwise copy.



-- 
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]

Reply via email to