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/08/02 06:40:02 UTC

[GitHub] [doris] SWJTU-ZhangLei commented on a diff in pull request #10792: [Feature][Materialized-View] support materialized view on vectorized engine

SWJTU-ZhangLei commented on code in PR #10792:
URL: https://github.com/apache/doris/pull/10792#discussion_r935169760


##########
fe/fe-core/src/main/java/org/apache/doris/alter/RollupJobV2.java:
##########
@@ -150,6 +151,55 @@ public RollupJobV2(long jobId, long dbId, long tableId, String tableName, long t
         this.rollupIndexName = rollupIndexName;
 
         this.rollupSchema = rollupSchema;
+
+        Database db = Env.getCurrentInternalCatalog().getDbOrException(dbId,
+                s -> new AnalysisException("Databasee " + s + " does not exist"));
+
+        OlapTable tbl;
+        try {
+            tbl = (OlapTable) db.getTableOrMetaException(tableId, Table.TableType.OLAP);
+        } catch (MetaNotFoundException e) {
+            throw new AnalysisException(e.getMessage());
+        }
+
+        IntSupplier colUniqueIdSupplier = new IntSupplier() {
+            public int pendingMaxColUniqueId = tbl.getMaxColUniqueId();
+
+            @Override
+            public int getAsInt() {
+                pendingMaxColUniqueId++;
+                return pendingMaxColUniqueId;
+            }

Review Comment:
   1、now in rollup, we don't support light schema change, this is unnecessary. 
   2、in the end, we also need update tbl max unique id . for example in  SchemaChangeJobV2.onFinished() , we do like this:
           //update max column unique id
           int maxColUniqueId = tbl.getMaxColUniqueId();
           for (Column column : tbl.getFullSchema()) {
               if (column.getUniqueId() > maxColUniqueId) {
                   maxColUniqueId = column.getUniqueId();
               }
           }
           tbl.setMaxColUniqueId(maxColUniqueId);
   
   
   3、i will refact the light schema change feature, here you can just delete this code about generating col_unique_id



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