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

 ##########
 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:
   In which case defaultDistributionInfo is random, however the partition is 
not random partition? 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to