Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,6 @@ public static void registerOrRemoveDynamicPartitionTable(long dbId, OlapTable ol
if (olapTable.getTableProperty() != null
&& olapTable.getTableProperty().getDynamicPartitionProperty() != null) {
if (olapTable.getTableProperty().getDynamicPartitionProperty().getEnable()) {
if (!isReplay) {
// execute create partition first time only in master of FE, So no need execute
// when it's replay
Env.getCurrentEnv().getDynamicPartitionScheduler()
.executeDynamicPartitionFirstTime(dbId, olapTable.getId());
}
Env.getCurrentEnv().getDynamicPartitionScheduler()
.registerDynamicPartitionTable(dbId, olapTable.getId());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2323,6 +2323,8 @@ private void createOlapTable(Database db, CreateTableStmt stmt) throws UserExcep
LOG.info("successfully create table[{};{}]", tableName, tableId);
// register or remove table from DynamicPartition after table created
DynamicPartitionUtil.registerOrRemoveDynamicPartitionTable(db.getId(), olapTable, false);
Env.getCurrentEnv().getDynamicPartitionScheduler()
.executeDynamicPartitionFirstTime(db.getId(), olapTable.getId());
Env.getCurrentEnv().getDynamicPartitionScheduler()
.createOrUpdateRuntimeInfo(tableId, DynamicPartitionScheduler.LAST_UPDATE_TIME,
TimeUtils.getCurrentFormatTime());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,11 +703,13 @@ public void testFillHistoryDynamicPartition3() throws Exception {
// history_partition_num too large, but because start is -10, so modify ok
String alter3 = "alter table test.dynamic_partition3 set ('dynamic_partition.history_partition_num' = '1000')";
ExceptionChecker.expectThrowsNoException(() -> alterTable(alter3));
Env.getCurrentEnv().getDynamicPartitionScheduler().executeDynamicPartitionFirstTime(db.getId(), tbl.getId());
Assert.assertEquals(14, tbl.getPartitionNames().size());

// set start and history_partition_num properly.
String alter4 = "alter table test.dynamic_partition3 set ('dynamic_partition.history_partition_num' = '100', 'dynamic_partition.start' = '-20')";
ExceptionChecker.expectThrowsNoException(() -> alterTable(alter4));
Env.getCurrentEnv().getDynamicPartitionScheduler().executeDynamicPartitionFirstTime(db.getId(), tbl.getId());
Assert.assertEquals(24, tbl.getPartitionNames().size());
}

Expand Down