JingsongLi commented on code in PR #1557:
URL: https://github.com/apache/incubator-paimon/pull/1557#discussion_r1267463040


##########
paimon-core/src/main/java/org/apache/paimon/mergetree/compact/LookupMergeTreeCompactRewriter.java:
##########
@@ -89,7 +89,7 @@ protected boolean upgradeChangelog(int outputLevel, 
DataFileMeta file) {
     protected MergeFunctionWrapper<ChangelogResult> createMergeWrapper(int 
outputLevel) {
         return new LookupChangelogMergeFunctionWrapper(
                 mfFactory,
-                key -> {
+                (key) -> {

Review Comment:
   revert this?



##########
paimon-core/src/test/java/org/apache/paimon/mergetree/compact/SortMergeReaderTestBase.java:
##########
@@ -139,4 +144,25 @@ public void testCancelingRecords(SortEngine sortEngine) 
throws IOException {
             runTest(parseData("1, 2, +, 100", "1, 1, +, -100"), sortEngine);
         }
     }
+
+    /** Test for {@link SortMergeReader} with {@link FirstRowMergeFunction}. */
+    public static class WithFirstRowMergeFunctionTest extends 
SortMergeReaderTestBase {

Review Comment:
   This is very good!



##########
paimon-core/src/main/java/org/apache/paimon/mergetree/compact/FullChangelogMergeFunctionWrapper.java:
##########
@@ -110,8 +112,9 @@ public ChangelogResult getResult() {
             } else {
                 if (merged == null || !isAdd(merged)) {
                     reusedResult.addChangelog(replace(reusedBefore, 
RowKind.DELETE, topLevelKv));
-                } else if (!changelogRowDeduplicate
-                        || !valueEqualiser.equals(topLevelKv.value(), 
merged.value())) {
+                } else if (!isFirstRow

Review Comment:
   Do we have more intuitive modifications for 
`FullChangelogMergeFunctionWrapper` and `LookupChangelogMergeFunctionWrapper`?
   
   If it is a first row, we should just return old value. And produce no 
changelog.
   Can we just have another wrapper? Maybe...
   



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