From 366f443445367c67c68d21e1708e868e5cfcdd49 Mon Sep 17 00:00:00 2001 From: qiye Date: Fri, 19 Jul 2024 14:28:40 +0800 Subject: [PATCH] [fix](inverted index)Support rename column with inverted index (#38079) Copy columns and properties to make them mutable. close #38078 --- .../src/main/java/org/apache/doris/catalog/Index.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Index.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/Index.java index a251b50673ae06..7aaaebf303e0bd 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Index.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Index.java @@ -28,6 +28,8 @@ import org.apache.doris.thrift.TIndexType; import org.apache.doris.thrift.TOlapTableIndex; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import com.google.gson.annotations.SerializedName; import org.apache.commons.lang3.StringUtils; @@ -67,9 +69,9 @@ public Index(long indexId, String indexName, List columns, IndexDef.IndexType indexType, Map properties, String comment) { this.indexId = indexId; this.indexName = indexName; - this.columns = columns; + this.columns = columns == null ? Lists.newArrayList() : Lists.newArrayList(columns); this.indexType = indexType; - this.properties = properties; + this.properties = properties == null ? Maps.newHashMap() : Maps.newHashMap(properties); this.comment = comment; if (indexType == IndexDef.IndexType.INVERTED) { if (this.properties != null && !this.properties.isEmpty()) {