yiguolei commented on a change in pull request #1695: Refactor alter job
URL: https://github.com/apache/incubator-doris/pull/1695#discussion_r318961674
##########
File path: fe/src/main/java/org/apache/doris/alter/RollupHandler.java
##########
@@ -270,93 +273,56 @@ private void processAddRollup(AddRollupClause
alterClause, Database db, OlapTabl
}
}
- // 4. do create things
- // 4.1 get storage type. default is COLUMN
-
- TKeysType rollupKeysType;
- if (keysType == KeysType.DUP_KEYS) {
- rollupKeysType = TKeysType.DUP_KEYS;
- } else if (keysType == KeysType.UNIQUE_KEYS) {
- rollupKeysType = TKeysType.UNIQUE_KEYS;
- } else {
- rollupKeysType = TKeysType.AGG_KEYS;
- }
+ // assign rollup index's key type, same as base index's
+ KeysType rollupKeysType = keysType;
- Map<String, String> properties = alterClause.getProperties();
- TStorageType rollupStorageType = null;
- try {
- rollupStorageType =
PropertyAnalyzer.analyzeStorageType(properties);
- } catch (AnalysisException e) {
- throw new DdlException(e.getMessage());
- }
- // check storage type if has null column
- boolean hasNullColumn = false;
- for (Column column : rollupSchema) {
- if (column.isAllowNull()) {
- hasNullColumn = true;
- break;
- }
- }
- if (hasNullColumn && rollupStorageType != TStorageType.COLUMN) {
- throw new DdlException("Only column rollup support null columns");
- }
-
- // 4.2 get rollup schema hash
- int schemaVersion = 0;
- try {
- schemaVersion = PropertyAnalyzer.analyzeSchemaVersion(properties);
- } catch (AnalysisException e) {
- throw new DdlException(e.getMessage());
- }
- int rollupSchemaHash = Util.schemaHash(schemaVersion, rollupSchema,
olapTable.getCopiedBfColumns(),
+ // get rollup schema hash
+ int rollupSchemaHash = Util.schemaHash(0 /* init schema version */,
rollupSchema, olapTable.getCopiedBfColumns(),
Review comment:
Not use schema hash 0, because we do not know whether be is used this
----------------------------------------------------------------
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]