dataroaring commented on code in PR #47300: URL: https://github.com/apache/doris/pull/47300#discussion_r1961686380
########## fe/fe-core/src/main/java/org/apache/doris/catalog/Index.java: ########## @@ -268,10 +268,20 @@ public OlapFile.TabletIndexPB toPb(Map<Integer, Column> columnMap) { OlapFile.TabletIndexPB.Builder builder = OlapFile.TabletIndexPB.newBuilder(); builder.setIndexId(indexId); builder.setIndexName(indexName); - for (Integer columnUniqueId : columnUniqueIds) { - Column column = columnMap.get(columnUniqueId); - if (column != null) { - builder.addColUniqueId(column.getUniqueId()); + if (columnUniqueIds != null) { + for (Integer columnUniqueId : columnUniqueIds) { + Column column = columnMap.get(columnUniqueId); + if (column != null) { + builder.addColUniqueId(column.getUniqueId()); + } + } + } else { + for (String columnName : columns) { + for (Column column : columnMap.values()) { + if (column.getName().equals(columnName)) { + builder.addColUniqueId(column.getUniqueId()); + } + } Review Comment: need case. -- 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-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org