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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/BatchInsertIntoTableCommand.java:
##########
@@ -145,6 +144,10 @@ public void run(ConnectContext ctx, StmtExecutor executor) 
throws Exception {
                     
.<TreeNode<?>>collect(PhysicalOlapTableSink.class::isInstance).stream().findAny();
             Preconditions.checkArgument(plan.isPresent(), "insert into command 
must contain OlapTableSinkNode");
             sink = ((PhysicalOlapTableSink<?>) plan.get());
+            if (sink.isPartialUpdate()) {

Review Comment:
   [P2] Preserve full-row inserts that omit generated columns
   
   For a MoW table `t(k INT, v INT, g INT AS(v+1))`, issue `SET 
enable_unique_key_partial_update=true` and `BEGIN` as separate requests, then 
run `INSERT INTO t(k,v) VALUES(1,10)`. It now hits this error even though every 
writable data column is supplied. `InsertUtils.normalizePlan` counts the 
omitted visible `g` as missing and retains `partial=true`, but 
`BindSink.bindTargetColumns` adds `g` and `getColumnToOutput` computes it, 
yielding the complete bound shape `OlapSink(partial=true, cols=[k,v,g])` over 
`OneRow(1,10,11)`. The previous batch path sent matching `(k,v,g)` 
columns/values as an UPSERT; it did not need to recover an omitted ordinary 
value. Normalize generated-only omissions to full-row mode before applying this 
guard and cover this shape in the regression test.



##########
regression-test/suites/insert_p0/transaction/test_txn_values_partial_update.groovy:
##########
@@ -0,0 +1,87 @@
+// 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_txn_values_partial_update") {

Review Comment:
   [P2] Exclude this suite when fuzzy cluster keys are enabled
   
   With `random_add_order_by_keys_for_mow=true` (enabled by daily/rqg fuzzy 
runs on even days), `CreateTableInfo` adds at least one cluster key to this 
all-INT MoW table. `InsertUtils.normalizePlan` then clears the partial-update 
flag for cluster-key tables, so the first partial VALUES statement does not 
raise the exception required here and the suite fails. The existing 
`Config.excludeUnsupportedCase` exclusions cover the other partial-update 
suites but do not match this new name or directory. Add this suite to that 
exclusion mechanism, or otherwise ensure its table cannot receive fuzzy cluster 
keys, so it consistently exercises the intended partial-update path.



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