airborne12 commented on code in PR #69445:
URL: https://github.com/apache/doris/pull/69445#discussion_r4348017614


##########
fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java:
##########
@@ -2376,8 +2381,13 @@ public int getAsInt() {
             Map<Long, Set<String>> indexOnPartitions = new HashMap<>();
             boolean isDropIndex = false;
             Map<String, String> propertyMap = new HashMap<>();
-            Map<String, List<String>> sequenceMapping = 
olapTable.getColumnSeqMapping() == null ? new HashMap<>()
-                    : new HashMap<>(olapTable.getColumnSeqMapping());
+            // Copy the column groups too: processDropSequenceMapping removes 
columns from them, and the table's
+            // mapping must only change through the schema change job.
+            Map<String, List<String>> sequenceMapping = new HashMap<>();
+            if (olapTable.getColumnSeqMapping() != null) {
+                olapTable.getColumnSeqMapping().forEach(
+                        (seqColumn, columnGroup) -> 
sequenceMapping.put(seqColumn, new ArrayList<>(columnGroup)));

Review Comment:
   Good catch, fixed in c55ea1d8. The mapping is copied shallowly again, so 
successful statements behave as before (including this light index change 
case), and the contents of the table's mapping groups are added to the snapshot 
that is restored when the statement ends before publishing. 
testFailedAlterKeepsLiveColumnMetadata now also runs `DROP COLUMN c, DROP 
COLUMN d, ADD INDEX idx_k1 (k1) USING INVERTED` and checks the group is empty 
afterwards; that assertion fails with the previous commit.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to