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


##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -1126,6 +1127,14 @@ public boolean isProfileSafeStmt() {
             return true;
         }
 
+        // Computed DML profiles are currently only supported for OLAP target 
tables.
+        if ((plan instanceof UpdateCommand && ((UpdateCommand) 
plan).isTargetTableOlap(context))
+                || (plan instanceof MergeIntoCommand && ((MergeIntoCommand) 
plan).isTargetTableOlap(context))
+                || (plan instanceof DeleteFromUsingCommand

Review Comment:
   This still misses a computed delete path that is distinct from the existing 
Iceberg review thread. A plain `DELETE` without `USING` parses as 
`DeleteFromCommand`, but for a unique MOW table with 
`enable_mow_light_delete=false` (the FE default), `DeleteFromCommand.run()` 
reaches its `!olapTable.getEnableMowLightDelete()` branch and delegates to `new 
DeleteFromUsingCommand(...).run()`. That path executes through 
`InsertIntoTableCommand` and sets the profile type to `LOAD`, but every 
`executor.isProfileSafeStmt()` call still inspects the original parsed plan, 
which is `DeleteFromCommand`, so this allowlist returns false and 
`updateProfile(...)` suppresses the profile.
   
   A minimal case is:
   
   ```sql
   CREATE TABLE t (k int, v int)
   UNIQUE KEY(k)
   DISTRIBUTED BY HASH(k) BUCKETS 1
   PROPERTIES (
     "replication_num" = "1",
     "enable_unique_key_merge_on_write" = "true",
     "enable_mow_light_delete" = "false"
   );
   DELETE FROM t WHERE v = 10;
   ```
   
   `EXPLAIN` for this class of delete already shows the partial-update/insert 
path in existing tests, so if computed DML profiles are meant to follow the 
execution path, this needs to mark the delegated `DeleteFromCommand` case as 
safe as well, or set the profile-safe state when `DeleteFromCommand` actually 
switches to `DeleteFromUsingCommand`. The new regression's negative case uses a 
duplicate-key storage delete, so it would not catch this missing MOW fallback 
profile.



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