github-actions[bot] commented on code in PR #69704:
URL: https://github.com/apache/doris/pull/69704#discussion_r4391126549


##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergConnectorTransaction.java:
##########
@@ -732,6 +737,9 @@ public long getUpdateCnt() {
                 dataRows += affectedRows;
             }
         }
+        if (hasActionScopedDeleteRows) {
+            return dataRows + deleteOnlyRows;

Review Comment:
   [P2] Preserve delete counts from older BE producers
   
   During a partial BE upgrade, a delete-only MERGE can receive an old-BE 
POSITION_DELETES item with affected_rows=2 and no delete_only_rows, plus a 
new-BE item with affected_rows=3 and delete_only_rows=3. Seeing the latter 
makes this branch return 3 instead of the previous correct total of 5. The 
distributed MERGE sink can run on both BEs, and the new marker is emitted 
without a query-wide execution-version gate, so the fallback only protects 
all-old reports. Preserve the full delete total for delete-only results or 
negotiate action-count support for the whole query, and add a test containing 
both marked and unmarked producers.



##########
regression-test/suites/external_table_p0/iceberg/dml/test_iceberg_merge_into_advanced.groovy:
##########
@@ -187,6 +187,20 @@ suite("test_iceberg_merge_into_advanced", 
"p0,external,iceberg,external_docker,e
         def q_check_m3 = "order_qt_${format}_check_m3"
         "${q_check_m3}" """SELECT * FROM ${formatTableName}"""
 
+        // Mixed standalone DELETE and INSERT actions must both contribute to 
the client row count.
+        def mergeCountResult = sql """
+            MERGE INTO ${formatTableName} t
+            USING (
+                SELECT 4 AS id, 'delete' AS action, 'unused' AS name
+                UNION ALL
+                SELECT 6 AS id, 'insert' AS action, 'Frank' AS name
+            ) s
+            ON t.id = s.id
+            WHEN MATCHED AND s.action = 'delete' THEN DELETE
+            WHEN NOT MATCHED THEN INSERT (id, name) VALUES (s.id, s.name)
+        """
+        assertEquals("2", mergeCountResult[0][0].toString())

Review Comment:
   [P2] Update the advanced MERGE regression expectations
   
   This suite's unchanged .out disagrees with the patch in both formats. Even 
before this new block, multi_when updates id=2 and deletes id=3, so the 
corrected affected-row count is 2 while parquet_multi_when/orc_multi_when still 
expect 1. The added MERGE also removes id=4 and inserts id=6, but check_m4 
still expects Dora at id=4 and no Frank, and subquery_del still expects one 
deletion of id=4. The suite therefore fails with the intended implementation. 
Isolate or restore this case's table state and regenerate the affected golden 
results through the regression runner, including the earlier changed action 
count.



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

Reply via email to