morningman commented on a change in pull request #246: Colocate Join (#245)
URL: https://github.com/apache/incubator-doris/pull/246#discussion_r239309523
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/catalog/Catalog.java
 ##########
 @@ -3270,6 +3309,33 @@ private Table createOlapTable(Database db, 
CreateTableStmt stmt, boolean isResto
             throw new DdlException(e.getMessage());
         }
 
+        // colocateTable
+        try {
+            String colocateTable = 
PropertyAnalyzer.analyzeColocate(properties);
+            if (colocateTable != null) {
+                Table parentTable = ColocateTableUtils.getColocateTable(db, 
colocateTable);
+                //for colocate child table
+                if (!colocateTable.equalsIgnoreCase(tableName)) {
+                    ColocateTableUtils.checkTableExist(parentTable, 
colocateTable);
+
+                    ColocateTableUtils.checkTableType(parentTable);
+
+                    ColocateTableUtils.checkBucketNum((OlapTable) parentTable, 
distributionInfo);
+
+                    
ColocateTableUtils.checkDistributionColumnSizeAndType((OlapTable) parentTable, 
distributionInfo);
+
+                    getColocateTableIndex().addTableToGroup(db.getId(), 
tableId, parentTable.getId());
 
 Review comment:
   If exception throw after this, you need to clean the table2Group 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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