morrySnow commented on code in PR #36579:
URL: https://github.com/apache/doris/pull/36579#discussion_r1680578631


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertUtils.java:
##########
@@ -395,16 +411,21 @@ private static Expression castValue(Expression value, 
DataType targetType) {
      */
     public static TableIf getTargetTable(Plan plan, ConnectContext ctx) {
         UnboundLogicalSink<? extends Plan> unboundTableSink;
-        if (plan instanceof UnboundTableSink) {
-            unboundTableSink = (UnboundTableSink<? extends Plan>) plan;
-        } else if (plan instanceof UnboundHiveTableSink) {
-            unboundTableSink = (UnboundHiveTableSink<? extends Plan>) plan;
-        } else if (plan instanceof UnboundIcebergTableSink) {
-            unboundTableSink = (UnboundIcebergTableSink<? extends Plan>) plan;
+        Plan sinkPlan = plan;
+        if (plan instanceof LogicalStatementHint) {

Review Comment:
   too many `if (plan instanceOf LogicalStatementHint) {...} else {...}` in 
different place. Maybe it is better to save hint in InserIntoTableCommand, and 
add it back to plan tree before do real plan in `initPlan`. or do `eliminate 
logical statement` at very begining in InsertIntoTableCommand



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java:
##########
@@ -117,7 +117,9 @@ private Plan 
bindOlapTableSink(MatchingContext<UnboundTableSink<Plan>> ctx) {
         Pair<Database, OlapTable> pair = bind(ctx.cascadesContext, sink);
         Database database = pair.first;
         OlapTable table = pair.second;
-        boolean isPartialUpdate = sink.isPartialUpdate() && 
table.getKeysType() == KeysType.UNIQUE_KEYS;
+        boolean isPartialUpdate = (table.getKeysType() == KeysType.UNIQUE_KEYS
+                && table.getEnableUniqueKeyMergeOnWrite() && 
(sink.isPartialUpdate()
+                || 
ctx.cascadesContext.getConnectContext().getSessionVariable().isEnableUniqueKeyPartialUpdate()));

Review Comment:
   changes not related with this PR?



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to