This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 88ba7b4aae3 branch-4.0: [Opt](partial update) Init partial update 
related fields only when it's partial update #59930 (#60200)
88ba7b4aae3 is described below

commit 88ba7b4aae3af52bbf6f1bef74104a2a214e9d5a
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Jan 30 16:36:57 2026 +0800

    branch-4.0: [Opt](partial update) Init partial update related fields only 
when it's partial update #59930 (#60200)
    
    Cherry-picked from #59930
    
    Co-authored-by: bobhan1 <[email protected]>
---
 be/src/olap/partial_update_info.cpp | 39 +++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/be/src/olap/partial_update_info.cpp 
b/be/src/olap/partial_update_info.cpp
index 666932df661..0cbcd8c83ac 100644
--- a/be/src/olap/partial_update_info.cpp
+++ b/be/src/olap/partial_update_info.cpp
@@ -72,34 +72,35 @@ Status PartialUpdateInfo::init(int64_t tablet_id, int64_t 
txn_id, const TabletSc
             }
         }
     }
-
-    for (auto i = 0; i < tablet_schema.num_columns(); ++i) {
-        if (partial_update_mode == 
UniqueKeyUpdateModePB::UPDATE_FIXED_COLUMNS) {
-            auto tablet_column = tablet_schema.column(i);
-            if (!partial_update_input_columns.contains(tablet_column.name())) {
-                missing_cids.emplace_back(i);
-                if (!tablet_column.has_default_value() && 
!tablet_column.is_nullable() &&
-                    tablet_schema.auto_increment_column() != 
tablet_column.name()) {
-                    can_insert_new_rows_in_partial_update = false;
+    if (is_partial_update()) {
+        for (auto i = 0; i < tablet_schema.num_columns(); ++i) {
+            if (partial_update_mode == 
UniqueKeyUpdateModePB::UPDATE_FIXED_COLUMNS) {
+                auto tablet_column = tablet_schema.column(i);
+                if 
(!partial_update_input_columns.contains(tablet_column.name())) {
+                    missing_cids.emplace_back(i);
+                    if (!tablet_column.has_default_value() && 
!tablet_column.is_nullable() &&
+                        tablet_schema.auto_increment_column() != 
tablet_column.name()) {
+                        can_insert_new_rows_in_partial_update = false;
+                    }
+                } else {
+                    update_cids.emplace_back(i);
+                }
+                if (auto_increment_column == tablet_column.name()) {
+                    is_schema_contains_auto_inc_column = true;
                 }
             } else {
-                update_cids.emplace_back(i);
-            }
-            if (auto_increment_column == tablet_column.name()) {
-                is_schema_contains_auto_inc_column = true;
-            }
-        } else {
-            // in flexible partial update, missing cids is all non sort keys' 
cid
-            if (i >= tablet_schema.num_key_columns()) {
-                missing_cids.emplace_back(i);
+                // in flexible partial update, missing cids is all non sort 
keys' cid
+                if (i >= tablet_schema.num_key_columns()) {
+                    missing_cids.emplace_back(i);
+                }
             }
         }
+        _generate_default_values_for_missing_cids(tablet_schema);
     }
     is_strict_mode = is_strict_mode_;
     is_input_columns_contains_auto_inc_column =
             is_fixed_partial_update() &&
             partial_update_input_columns.contains(auto_increment_column);
-    _generate_default_values_for_missing_cids(tablet_schema);
     return Status::OK();
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to