From 5e64e076340afc7584994a91c2a4a7dd659da5b1 Mon Sep 17 00:00:00 2001 From: jackylee Date: Fri, 31 Jul 2026 21:07:01 +0800 Subject: [PATCH] docs: correct three wrong default values in CoreOptions doc comments Three accessor doc comments state defaults that disagree with the constants right next to them: - `bucket()` says "Default is 1" but `DEFAULT_BUCKET` is `-1`; the existing test asserts `bucket() == -1`, and Java defaults to `-1` as well. - `target_file_size()` says "Default is 128MB" but `DEFAULT_TARGET_FILE_SIZE` is 256 MiB. Java gives `target-file-size` no default and documents 128 MB for primary-key tables and 256 MB for append tables, so record which value this returns. - `dynamic_bucket_target_row_num()` claims 200,000 matches Java, but Java defaults `dynamic-bucket.target-row-num` to 2,000,000. State the difference instead of asserting parity; the constant is left alone. Comments only, no behavior change. --- crates/paimon/src/spec/core_options.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/paimon/src/spec/core_options.rs b/crates/paimon/src/spec/core_options.rs index 507471c88..e44f5e373 100644 --- a/crates/paimon/src/spec/core_options.rs +++ b/crates/paimon/src/spec/core_options.rs @@ -870,7 +870,7 @@ impl<'a> CoreOptions<'a> { .unwrap_or(DEFAULT_MANIFEST_MERGE_MIN_COUNT) } - /// Number of buckets for the table. Default is 1. + /// Number of buckets for the table. Default is -1 (dynamic bucket). pub fn bucket(&self) -> i32 { self.options .get(BUCKET_OPTION) @@ -896,7 +896,11 @@ impl<'a> CoreOptions<'a> { } } - /// Target file size for data files. Default is 128MB. + /// Target file size for data files. Default is 256MB. + /// + /// Java leaves `target-file-size` without a default and documents 128 MB for + /// primary-key tables and 256 MB for append tables; this returns the append + /// value for both. pub fn target_file_size(&self) -> i64 { self.options .get("target-file-size") @@ -1086,7 +1090,7 @@ impl<'a> CoreOptions<'a> { /// Target row number per bucket for dynamic bucket mode (bucket=-1). /// When a bucket reaches this number, a new bucket is created. - /// Default is 200,000 (matching Java Paimon). + /// Default is 200,000. Java Paimon defaults this to 2,000,000. pub fn dynamic_bucket_target_row_num(&self) -> i64 { self.options .get(DYNAMIC_BUCKET_TARGET_ROW_NUM_OPTION)