morrySnow commented on code in PR #24657:
URL: https://github.com/apache/doris/pull/24657#discussion_r1331364850
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -353,6 +354,19 @@ public PlanFragment
visitPhysicalOlapTableSink(PhysicalOlapTableSink<? extends P
PlanFragment rootFragment = olapTableSink.child().accept(this,
context);
rootFragment.setOutputPartition(DataPartition.UNPARTITIONED);
+ if (olapTableSink.isIgnoreMode()) {
+ OlapTable dstTable = olapTableSink.getTargetTable();
+ if (dstTable.getKeysType() != KeysType.UNIQUE_KEYS ||
!dstTable.getEnableUniqueKeyMergeOnWrite()) {
+ throw new AnalysisException("ignore mode can only be enabled
if the target table is "
+ + "a unique table with merge-on-write enabled.");
+ } else if (olapTableSink.isPartialUpdate()) {
+ throw new AnalysisException("ignore mode can't be used in
partial update.");
+ } else if (olapTableSink.getTargetTable().hasSequenceCol()) {
+ throw new AnalysisException("ignore mode can't be used if the
target table has sequence column, "
+ + "but table[" + dstTable.getName() + "] has sequnce
column.");
+ }
Review Comment:
i think we should check this in bindSink
--
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]