JingsongLi commented on a change in pull request #58:
URL: https://github.com/apache/flink-table-store/pull/58#discussion_r834909405



##########
File path: 
flink-table-store-core/src/main/java/org/apache/flink/table/store/sink/SinkRecordConverter.java
##########
@@ -55,15 +68,31 @@ public SinkRecord convert(RowData row) {
         return new SinkRecord(partition, bucket, primaryKey, row);
     }
 
+    public SinkRecord convertToLogSinkRecord(SinkRecord record) {
+        if (logPkProjection == null) {
+            return record;
+        }
+        BinaryRowData logPrimaryKey = logPrimaryKey(record.row());
+        return new SinkRecord(record.partition(), record.bucket(), 
logPrimaryKey, record.row());
+    }
+
     public BinaryRowData primaryKey(RowData row) {
         return pkProjection.apply(row);
     }
 
+    private BinaryRowData logPrimaryKey(RowData row) {
+        return logPkProjection.apply(row);
+    }
+
     public int bucket(RowData row, BinaryRowData primaryKey) {
         int hash = primaryKey.getArity() == 0 ? hashRow(row) : 
primaryKey.hashCode();
         return Math.abs(hash % numBucket);
     }
 
+    public boolean reuseRecord() {

Review comment:
       Remove this method? `convertToLogSinkRecord` is enough:
   ```
   if (logPkProjection == null) {
               return record;
           }
   ```




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to