xiaokang commented on code in PR #17982: URL: https://github.com/apache/doris/pull/17982#discussion_r1145639518
########## fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java: ########## @@ -608,9 +608,11 @@ public List<Column> getKeyColumnsByIndexId(Long indexId) { ArrayList<Column> keyColumns = Lists.newArrayList(); List<Column> allColumns = this.getSchemaByIndexId(indexId); for (Column column : allColumns) { - if (column.isKey()) { - keyColumns.add(column); + // Key columns are awalys in the front of other columns + if (!column.isKey()) { Review Comment: It's not safe to assume keys are prefix of column list. -- 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