Gabriel39 commented on code in PR #66302:
URL: https://github.com/apache/doris/pull/66302#discussion_r3689503173


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java:
##########
@@ -736,6 +736,7 @@ private Plan 
bindIcebergTableSink(MatchingContext<UnboundIcebergTableSink<Plan>>
         Pair<IcebergExternalDatabase, IcebergExternalTable> pair = 
bind(ctx.cascadesContext, sink);
         IcebergExternalDatabase database = pair.first;
         IcebergExternalTable table = pair.second;
+        IcebergUtils.validateWriteSchema(table.getFullSchema());

Review Comment:
   Fixed. BindSink now validates the exact latest targetSchema loaded for the 
sink, independent of a historical source snapshot. A historical self-insert 
regression covers this case.



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalIcebergMergeSink.java:
##########
@@ -69,6 +70,9 @@ public LogicalIcebergMergeSink(IcebergExternalDatabase 
database,
         this.targetTable = Objects.requireNonNull(targetTable, "targetTable != 
null in LogicalIcebergMergeSink");
         this.targetIcebergTable = Objects.requireNonNull(
                 targetIcebergTable, "targetIcebergTable != null in 
LogicalIcebergMergeSink");
+        // UPDATE and MERGE construct this sink directly and rewrite every 
base column; validate at
+        // the shared sink boundary so an unchanged Variant cannot enter the 
unsupported writer.
+        IcebergUtils.validateWriteSchema(this.targetTable.getFullSchema());

Review Comment:
   Fixed. writes_data_files is propagated through FE planning and thrift; BE 
constructs the data writer only when required. Delete-only Variant MERGE is 
covered by planner, BE sink, and external regression tests.



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