You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/13 09:53:48 UTC

[GitHub] [doris] morningman commented on a diff in pull request #10812: [Enhancement](dynamic partition) dynamic partition addPartition should be allowed when distributionCol…

morningman commented on code in PR #10812:
URL: https://github.com/apache/doris/pull/10812#discussion_r919881933


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/InternalDataSource.java:
##########
@@ -1258,11 +1258,24 @@ public void addPartition(Database db, String tableName, AddPartitionClause addPa
                     List<Column> newDistriCols = hashDistributionInfo.getDistributionColumns();
                     List<Column> defaultDistriCols =
                             ((HashDistributionInfo) defaultDistributionInfo).getDistributionColumns();
-                    if (!newDistriCols.equals(defaultDistriCols)) {
+                    if (newDistriCols.size() != defaultDistriCols.size()) {
                         throw new DdlException(
                                 "Cannot assign hash distribution with different distribution cols. " + "default is: "
                                         + defaultDistriCols);
+                    } else {
+                        for (int i = 0; i < defaultDistriCols.size(); i++) {

Review Comment:
   Please add comment to explain why we only check name and type.
   And I think name can also be ignored.



-- 
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-unsubscribe@doris.apache.org

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


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