EmmyMiao87 commented on a change in pull request #3036: Support different keys type between mv and base table URL: https://github.com/apache/incubator-doris/pull/3036#discussion_r388051704
########## File path: fe/src/main/java/org/apache/doris/catalog/OlapTable.java ########## @@ -501,61 +506,25 @@ public Status resetIdsForRestore(Catalog catalog, Database db, int restoreReplic return keyColumns; } - // schema version - public int getSchemaVersionByIndexId(Long indexId) { - if (indexIdToSchemaVersion.containsKey(indexId)) { - return indexIdToSchemaVersion.get(indexId); - } - return -1; - } - // schemaHash public Map<Long, Integer> getIndexIdToSchemaHash() { - return indexIdToSchemaHash; - } - - public Map<Long, Integer> getCopiedIndexIdToSchemaHash() { - return new HashMap<>(indexIdToSchemaHash); - } - - public int getSchemaHashByIndexId(Long indexId) { - if (indexIdToSchemaHash.containsKey(indexId)) { - return indexIdToSchemaHash.get(indexId); + Map<Long, Integer> result = Maps.newHashMap(); + for (Map.Entry<Long, MaterializedIndexMeta> entry : indexIdToMeta.entrySet()) { + result.put(entry.getKey(), entry.getValue().getSchemaHash()); } - return -1; - } - - // short key - public Map<Long, Short> getIndexIdToShortKeyColumnCount() { - return indexIdToShortKeyColumnCount; - } - - public Map<Long, Short> getCopiedIndexIdToShortKeyColumnCount() { - return new HashMap<>(indexIdToShortKeyColumnCount); + return result; } - public short getShortKeyColumnCountByIndexId(Long indexId) { - if (indexIdToShortKeyColumnCount.containsKey(indexId)) { - return indexIdToShortKeyColumnCount.get(indexId); + public int getSchemaHashByIndexId(Long indexId) { + MaterializedIndexMeta indexMeta = indexIdToMeta.get(indexId); + if (indexMeta == null) { + return -1; } - return (short) -1; - } - - // storage type - public Map<Long, TStorageType> getIndexIdToStorageType() { - return indexIdToStorageType; - } - - public Map<Long, TStorageType> getCopiedIndexIdToStorageType() { - return new HashMap<>(indexIdToStorageType); - } - - public void setStorageTypeToIndex(Long indexId, TStorageType storageType) { - indexIdToStorageType.put(indexId, storageType); + return indexMeta.getSchemaHash(); } public TStorageType getStorageTypeByIndexId(Long indexId) { - return indexIdToStorageType.get(indexId); + return indexIdToMeta.get(indexId).getStorageType(); Review comment: fixed ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org