nooneuse commented on code in PR #66307:
URL: https://github.com/apache/doris/pull/66307#discussion_r3703744496


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/AddConstraintCommand.java:
##########
@@ -92,6 +93,13 @@ public void run(ConnectContext ctx, StmtExecutor executor) 
throws Exception {
         } else if (constraint.isUnique()) {
             addConstraintAndInvalidate(
                     tableNameInfo, new UniqueConstraint(name, 
ImmutableSet.copyOf(columns)));
+        } else if (constraint.isDistributionMapping()) {
+            Pair<ImmutableList<String>, TableIf> distributionColumnsAndTable =
+                    extractColumnsAndTable(ctx, 
constraint.toDistributionProject());
+            Preconditions.checkState(table.getId() == 
distributionColumnsAndTable.second.getId(),
+                    "determinant and distribution columns must belong to the 
same table");
+            addConstraintAndInvalidate(tableNameInfo, new 
DistributionMappingConstraint(
+                    name, constraint.getMappingId(), columns, 
distributionColumnsAndTable.first));

Review Comment:
   You're right. I'll fix it.



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