zhannngchen commented on code in PR #31461:
URL: https://github.com/apache/doris/pull/31461#discussion_r1508609779


##########
be/src/olap/rowset_builder.cpp:
##########
@@ -368,6 +369,11 @@ void 
BaseRowsetBuilder::_build_current_tablet_schema(int64_t index_id,
     _tablet_schema->set_table_id(table_schema_param->table_id());
     // set partial update columns info
     _partial_update_info = std::make_shared<PartialUpdateInfo>();
+    DBUG_EXECUTE_IF(
+            
"BaseRowsetBuilder::_build_current_tablet_schema.check_partial_update_column_num",
 {
+                
EXPECT_EQ(table_schema_param->partial_update_input_columns().size(),

Review Comment:
   It's better to add the debug point before calling 
`_build_current_tablet_schema`, check the partial update input columns of 
`_req.table_schema_param`, if not match, return an error code. Then you don't 
need to import gtest dependency here.



##########
regression-test/suites/partition_p0/auto_partition/test_auto_partition_behavior.groovy:
##########
@@ -61,11 +61,13 @@ suite("test_auto_partition_behavior") {
     assertEquals(result.size(), 9)
     qt_sql3 """ select str,length(str) from unique_table order by `str` """
     // modify value 
+    /*
     sql """ update unique_table set str = "modified" where str in (" ", "  ") 
""" // only "  "

Review Comment:
   If the code is not useful anymore, just delete it instead of commenting it 
out



##########
regression-test/suites/data_model_p0/unique/test_unique_table_update.groovy:
##########
@@ -0,0 +1,85 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_unique_table_update","nonConcurrent") {
+
+
+    def tableName = "test_unique_table_update"
+ 
+    // test successful group commit async load
+    sql """ DROP TABLE IF EXISTS ${tableName} """
+
+    sql """
+        CREATE TABLE ${tableName}
+            (k bigint,   v1 string, v2 string, v3 string, v4 string )
+            UNIQUE KEY(k)
+            DISTRIBUTED BY HASH (k) 
+            BUCKETS 32   
+            PROPERTIES(
+                "replication_num" = "1",
+                "enable_unique_key_merge_on_write"="true");
+        """
+
+    sql "insert into ${tableName} values(1,1,1,1,1),(2,2,2,2,2),(3,3,3,3,3);"
+    qt_select_1 "select * from ${tableName} order by k;"
+
+    sql "set enable_nereids_planner=true"
+    sql "set enable_fallback_to_original_planner=false"
+
+    // update key is not allowed
+    try {
+        sql "update ${tableName} set k=1, v1=1, v2=1 where k=2;"
+        assertTrue(false) 
+    } catch (Exception e) {
+        logger.info(e.getMessage())
+        assertTrue(e.getMessage().contains("Only value columns of unique table 
could be updated"))
+    } finally {
+        qt_select_2 "select * from ${tableName} order by k;"
+    }
+
+    // update key is allowed

Review Comment:
   typo: update value is allowed



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