Skip to content

Commit

Permalink
[BugFix] primary key table support storage medium cool down
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
motto1314 committed Sep 10, 2024
1 parent 5dbaaf5 commit 90b8edf
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand All @@ -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.");
}
}
Expand Down

0 comments on commit 90b8edf

Please sign in to comment.