Skip to content

Commit 167bc12

Browse files
committed
feat: improve default configuration of auto partitioning
1 parent 22d9c94 commit 167bc12

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

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

Lines changed: 6 additions & 4 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,20 +962,21 @@ 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. "
968+
+ "The default value is 2, which means 2 partitions will be pre-created. If the 'table.auto-partition.time-unit' is 'DAY'(default), one precreated partition is for today and another one is for tomorrow. "
967969
+ "For example, if the current check time is 2024-11-11 and the value is "
968970
+ "configured as 3, then partitions 20241111, 20241112, 20241113 will be pre-created. "
969971
+ "If any one partition exists, it'll skip creating the partition.");
970972

971973
public static final ConfigOption<Integer> TABLE_AUTO_PARTITION_NUM_RETENTION =
972974
key("table.auto-partition.num-retention")
973975
.intType()
974-
.defaultValue(-1)
976+
.defaultValue(7)
975977
.withDescription(
976978
"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. "
979+
+ "The default value is 7 which means retains 7 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. "
980982
+ "The partitions earlier than 20241108 will be deleted.");

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)