From 90b8edf188390c1f8d02ebcb14145b1cfbdebfb5 Mon Sep 17 00:00:00 2001 From: motto1314 Date: Tue, 10 Sep 2024 15:35:39 +0800 Subject: [PATCH] [BugFix] primary key table support storage medium cool down 1. alter primary key table set storage_medium is ok, so cool down should support 2. partition and dynamic_partition is support date/integer, so cool down can support date/integer Signed-off-by: motto1314 --- .../main/java/com/starrocks/server/OlapTableFactory.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fe/fe-core/src/main/java/com/starrocks/server/OlapTableFactory.java b/fe/fe-core/src/main/java/com/starrocks/server/OlapTableFactory.java index 65376890e29cb..457978d36ca82 100644 --- a/fe/fe-core/src/main/java/com/starrocks/server/OlapTableFactory.java +++ b/fe/fe-core/src/main/java/com/starrocks/server/OlapTableFactory.java @@ -467,9 +467,6 @@ public Table createTable(LocalMetastore metastore, Database db, CreateTableStmt if (properties != null) { if (properties.containsKey(PropertyAnalyzer.PROPERTIES_STORAGE_COOLDOWN_TTL) || properties.containsKey(PropertyAnalyzer.PROPERTIES_STORAGE_COOLDOWN_TIME)) { - if (table.getKeysType() == KeysType.PRIMARY_KEYS) { - throw new DdlException("Primary key table does not support storage medium cool down currently."); - } if (partitionInfo instanceof ListPartitionInfo) { throw new DdlException("List partition table does not support storage medium cool down currently."); } @@ -482,8 +479,9 @@ public Table createTable(LocalMetastore metastore, Database db, CreateTableStmt "does not support storage medium cool down currently."); } Column column = partitionColumns.get(0); - if (!column.getType().getPrimitiveType().isDateType()) { - throw new DdlException("Only support partition is date type for" + + if (!column.getType().getPrimitiveType().isDateType() && + !column.getType().getPrimitiveType().isIntegerType()) { + throw new DdlException("Only support partition is date/integer type for" + " storage medium cool down currently."); } }