diff --git a/fe/fe-core/src/main/java/com/starrocks/catalog/MaterializedIndexMeta.java b/fe/fe-core/src/main/java/com/starrocks/catalog/MaterializedIndexMeta.java index 9ec68da12d5d0..e91b9a5f71660 100644 --- a/fe/fe-core/src/main/java/com/starrocks/catalog/MaterializedIndexMeta.java +++ b/fe/fe-core/src/main/java/com/starrocks/catalog/MaterializedIndexMeta.java @@ -58,8 +58,6 @@ import java.util.stream.Collectors; public class MaterializedIndexMeta implements Writable, GsonPostProcessable { - private static final long UNINITIALIZED_SCHEMA_ID = -1; - @SerializedName(value = "indexId") private long indexId; @SerializedName(value = "schema") @@ -92,9 +90,7 @@ public class MaterializedIndexMeta implements Writable, GsonPostProcessable { private Expr whereClause; private Set updateSchemaBackendId; - // Default constructor will be invoked by the gson library - private MaterializedIndexMeta() { - schemaId = UNINITIALIZED_SCHEMA_ID; + public MaterializedIndexMeta() { } public MaterializedIndexMeta(long indexId, List schema, int schemaVersion, int schemaHash, @@ -355,7 +351,7 @@ public static MaterializedIndexMeta read(DataInput in) throws IOException { @Override public void gsonPostProcess() throws IOException { - if (schemaId == UNINITIALIZED_SCHEMA_ID) { + if (schemaId <= 0) { schemaId = indexId; } // analyze define stmt