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 2019/09/18 05:53:17 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #1823: Add a ALTER operation to change distribution type from RANDOM to HASH

morningman commented on a change in pull request #1823: Add a ALTER operation to change distribution type from RANDOM to HASH
URL: https://github.com/apache/incubator-doris/pull/1823#discussion_r325492314
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/catalog/OlapTable.java
 ##########
 @@ -1115,4 +1115,20 @@ public int getKeysNum() {
         }
         return keysNum;
     }
+
+    public boolean convertRandomDistributionToHashDistribution() {
+        boolean hasChanged = false;
+        List<Column> baseSchema = indexIdToSchema.get(baseIndexId);
+        if (defaultDistributionInfo.getType() == DistributionInfoType.RANDOM) {
+            defaultDistributionInfo = ((RandomDistributionInfo) defaultDistributionInfo).toHashDistributionInfo(baseSchema);
+            hasChanged = true;
+        }
+        
+        for (Partition partition : idToPartition.values()) {
+            if (partition.convertRandomDistributionToHashDistribution(baseSchema)) {
 
 Review comment:
   I don't know, just for safety...

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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