Skip to content

Commit 86cc775

Browse files
authored
[common] improve default configuration of auto partitioning (#470)
1 parent 45352ce commit 86cc775

File tree

4 files changed

+34
-31
lines changed

4 files changed

+34
-31
lines changed

fluss-common/src/main/java/com/alibaba/fluss/config/ConfigOptions.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -936,9 +936,10 @@ public class ConfigOptions {
936936
public static final ConfigOption<AutoPartitionTimeUnit> TABLE_AUTO_PARTITION_TIME_UNIT =
937937
key("table.auto-partition.time-unit")
938938
.enumType(AutoPartitionTimeUnit.class)
939-
.noDefaultValue()
939+
.defaultValue(AutoPartitionTimeUnit.DAY)
940940
.withDescription(
941941
"The time granularity for auto created partitions. "
942+
+ "The default value is 'DAY'. "
942943
+ "Valid values are 'HOUR', 'DAY', 'MONTH', 'QUARTER', 'YEAR'. "
943944
+ "If the value is 'HOUR', the partition format for "
944945
+ "auto created is yyyyMMddHH. "
@@ -961,23 +962,25 @@ public class ConfigOptions {
961962
public static final ConfigOption<Integer> TABLE_AUTO_PARTITION_NUM_PRECREATE =
962963
key("table.auto-partition.num-precreate")
963964
.intType()
964-
.defaultValue(4)
965+
.defaultValue(2)
965966
.withDescription(
966967
"The number of partitions to pre-create for auto created partitions in each check for auto partition. "
967968
+ "For example, if the current check time is 2024-11-11 and the value is "
968969
+ "configured as 3, then partitions 20241111, 20241112, 20241113 will be pre-created. "
969-
+ "If any one partition exists, it'll skip creating the partition.");
970+
+ "If any one partition exists, it'll skip creating the partition. "
971+
+ "The default value is 2, which means 2 partitions will be pre-created. "
972+
+ "If the 'table.auto-partition.time-unit' is 'DAY'(default), one precreated partition is for today and another one is for tomorrow.");
970973

971974
public static final ConfigOption<Integer> TABLE_AUTO_PARTITION_NUM_RETENTION =
972975
key("table.auto-partition.num-retention")
973976
.intType()
974-
.defaultValue(-1)
977+
.defaultValue(7)
975978
.withDescription(
976979
"The number of history partitions to retain for auto created partitions in each check for auto partition. "
977-
+ "The default value is -1 which means retain all partitions. "
978980
+ "For example, if the current check time is 2024-11-11, time-unit is DAY, and the value is "
979981
+ "configured as 3, then the history partitions 20241108, 20241109, 20241110 will be retained. "
980-
+ "The partitions earlier than 20241108 will be deleted.");
982+
+ "The partitions earlier than 20241108 will be deleted. "
983+
+ "The default value is 7.");
981984

982985
public static final ConfigOption<Duration> TABLE_LOG_TTL =
983986
key("table.log.ttl")

fluss-connectors/fluss-connector-flink/src/test/java/com/alibaba/fluss/connector/flink/source/FlinkTableSourceBatchITCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void testLimitLogTableScan() throws Exception {
283283
@ValueSource(booleans = {true, false})
284284
void testCountPushDown(boolean partitionTable) throws Exception {
285285
String tableName = partitionTable ? preparePartitionedLogTable() : prepareLogTable();
286-
int expectedRows = partitionTable ? 20 : 5;
286+
int expectedRows = partitionTable ? 10 : 5;
287287
// normal scan
288288
String query = String.format("SELECT COUNT(*) FROM %s", tableName);
289289
assertThat(tEnv.explainSql(query))

0 commit comments

Comments
 (0)