This is an automated email from the ASF dual-hosted git repository.

yihua pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hudi-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new dbd2558b refactor: name the table create toggles *_enabled in rust and 
python (#927)
dbd2558b is described below

commit dbd2558b91dea0af1dc58f2908cf205fd03cdf54
Author: Y Ethan Guo <[email protected]>
AuthorDate: Fri Oct 30 09:10:20 2026 -0700

    refactor: name the table create toggles *_enabled in rust and python (#927)
    
    The Rust builder's with_metadata, with_record_index, with_column_stats and
    with_partition_stats become with_*_enabled, and HudiTable.create takes
    metadata_table_enabled, record_index_enabled, column_stats_enabled and
    partition_stats_enabled, matching the is_*_enabled queries on the read side.
    The builder's validation errors name these shared stems, so a Python caller
    reads the flag name it passes. hive_style_partitioning keeps its name.
---
 crates/core/src/write/create.rs                    | 40 +++++++++++-----------
 crates/core/src/write/rewrite/lifecycle_tests.rs   |  4 +--
 crates/core/tests/table_read_record_index_tests.rs |  6 ++--
 crates/core/tests/table_read_runtime_tests.rs      |  2 +-
 crates/core/tests/table_write_archival_tests.rs    |  2 +-
 .../core/tests/table_write_composite_keys_tests.rs |  4 +--
 crates/core/tests/table_write_lifecycle_tests.rs   | 12 +++----
 crates/core/tests/table_write_model_tests.rs       |  2 +-
 crates/core/tests/table_write_tests.rs             | 38 ++++++++++----------
 python/hudi/_internal.pyi                          | 18 +++++-----
 python/src/internal.rs                             | 32 ++++++++---------
 python/tests/test_table_write.py                   | 19 +++++-----
 12 files changed, 91 insertions(+), 88 deletions(-)

diff --git a/crates/core/src/write/create.rs b/crates/core/src/write/create.rs
index 25bf7253..b21ad23f 100644
--- a/crates/core/src/write/create.rs
+++ b/crates/core/src/write/create.rs
@@ -80,7 +80,7 @@ pub struct TableCreateBuilder {
     record_key_fields: Vec<String>,
     partition_fields: Vec<String>,
     ordering_fields: Vec<String>,
-    metadata_enabled: bool,
+    metadata_table_enabled: bool,
     record_index_enabled: bool,
     /// Java reads its record index key before the alternative.
     record_index_set_by_java_key: bool,
@@ -104,7 +104,7 @@ impl TableCreateBuilder {
             record_key_fields: Vec::new(),
             partition_fields: Vec::new(),
             ordering_fields: Vec::new(),
-            metadata_enabled: true,
+            metadata_table_enabled: true,
             record_index_enabled: true,
             record_index_set_by_java_key: false,
             // Match Spark engine defaults: column stats on when MDT is on.
@@ -173,8 +173,8 @@ impl TableCreateBuilder {
     ///
     /// Defaults to enabled. Disabling also turns off record/column/partition
     /// stats indexes; the table version is unchanged (v8+ works without MDT).
-    pub fn with_metadata(mut self, enabled: bool) -> Self {
-        self.metadata_enabled = enabled;
+    pub fn with_metadata_table_enabled(mut self, enabled: bool) -> Self {
+        self.metadata_table_enabled = enabled;
         if enabled {
             // MDT requires v8+; never downgrade an explicit v9 choice.
             if self.table_version < 8 {
@@ -193,7 +193,7 @@ impl TableCreateBuilder {
     ///
     /// Defaults to enabled. When disabled, writers use 
[`crate::index::SimpleIndex`].
     /// Requires metadata table enabled.
-    pub fn with_record_index(mut self, enabled: bool) -> Self {
+    pub fn with_record_index_enabled(mut self, enabled: bool) -> Self {
         self.record_index_enabled = enabled;
         self
     }
@@ -202,7 +202,7 @@ impl TableCreateBuilder {
     ///
     /// Defaults to enabled when metadata is on (Spark-aligned). Disabling also
     /// disables `partition_stats`.
-    pub fn with_column_stats(mut self, enabled: bool) -> Self {
+    pub fn with_column_stats_enabled(mut self, enabled: bool) -> Self {
         self.column_stats_enabled = enabled;
         if !enabled {
             self.partition_stats_enabled = false;
@@ -214,7 +214,7 @@ impl TableCreateBuilder {
     ///
     /// Defaults to enabled when metadata is on. Ignored for non-partitioned
     /// tables, matching Java's metadata writer.
-    pub fn with_partition_stats(mut self, enabled: bool) -> Self {
+    pub fn with_partition_stats_enabled(mut self, enabled: bool) -> Self {
         self.partition_stats_enabled = enabled;
         self
     }
@@ -233,13 +233,13 @@ impl TableCreateBuilder {
     /// being overridden. The Java writer's record index switch,
     /// `hoodie.metadata.global.record.level.index.enable` or its alternative
     /// `hoodie.metadata.record.index.enable`, acts as
-    /// [`Self::with_record_index`], read the way Java's 
`Boolean.parseBoolean` is.
+    /// [`Self::with_record_index_enabled`], read the way Java's 
`Boolean.parseBoolean` is.
     pub fn with_option(mut self, key: impl AsRef<str>, value: impl 
Into<String>) -> Self {
         let key = key.as_ref();
         let value = value.into();
         if key == RECORD_INDEX_ENABLE_KEYS[0] {
             self.record_index_set_by_java_key = true;
-            return self.with_record_index(value.eq_ignore_ascii_case("true"));
+            return 
self.with_record_index_enabled(value.eq_ignore_ascii_case("true"));
         }
         if key == RECORD_INDEX_ENABLE_KEYS[1] {
             if !self.record_index_set_by_java_key {
@@ -278,21 +278,21 @@ impl TableCreateBuilder {
             return Err(CoreError::Write("table name must be 
non-empty".to_string()));
         }
 
-        if self.record_index_enabled && !self.metadata_enabled {
+        if self.record_index_enabled && !self.metadata_table_enabled {
             return Err(CoreError::Write(
-                "record index requires the metadata table; call 
with_metadata(true) or with_record_index(false)"
+                "record_index requires the metadata table; set 
metadata_table_enabled to true or record_index_enabled to false"
                     .to_string(),
             ));
         }
-        if self.column_stats_enabled && !self.metadata_enabled {
+        if self.column_stats_enabled && !self.metadata_table_enabled {
             return Err(CoreError::Write(
-                "column_stats requires the metadata table; call 
with_metadata(true) or with_column_stats(false)"
+                "column_stats requires the metadata table; set 
metadata_table_enabled to true or column_stats_enabled to false"
                     .to_string(),
             ));
         }
         if self.partition_stats_enabled && !self.column_stats_enabled {
             return Err(CoreError::Write(
-                "partition_stats requires column_stats; call 
with_column_stats(true) or with_partition_stats(false)"
+                "partition_stats requires column_stats; set 
column_stats_enabled to true or partition_stats_enabled to false"
                     .to_string(),
             ));
         }
@@ -429,7 +429,7 @@ impl TableCreateBuilder {
         // Canonical MDT signal is hoodie.table.metadata.partitions (Java 
create).
         // Do not invent hoodie.metadata.enable / 
hoodie.metadata.record.index.enable
         // into hoodie.properties — those are write-side configs in Java.
-        if self.metadata_enabled {
+        if self.metadata_table_enabled {
             let mut partitions = vec!["files".to_string()];
             if self.record_index_enabled {
                 partitions.push("record_index".to_string());
@@ -587,7 +587,7 @@ impl TableCreateBuilder {
         // No data column is known before the first commit, so the column_stats
         // definition starts with the always-indexed meta fields; every commit
         // then sets it to the indexed columns (write::metadata).
-        let index_definition_written = self.metadata_enabled && 
self.column_stats_enabled;
+        let index_definition_written = self.metadata_table_enabled && 
self.column_stats_enabled;
         let finished: Result<()> = async {
             if self.timeline_layout_version == 2 {
                 let timeline_path: String = props
@@ -624,7 +624,7 @@ impl TableCreateBuilder {
                         .await?;
                 }
             }
-            if self.metadata_enabled {
+            if self.metadata_table_enabled {
                 bootstrap_metadata_table(
                     &storage,
                     &table_name,
@@ -813,9 +813,9 @@ mod lifecycle_tests {
         let dir = tempfile::tempdir().unwrap();
         let _ = Table::create(dir.path().to_str().unwrap())
             .with_table_name("nometa")
-            .with_metadata(false)
-            .with_record_index(false)
-            .with_column_stats(false)
+            .with_metadata_table_enabled(false)
+            .with_record_index_enabled(false)
+            .with_column_stats_enabled(false)
             .with_populates_meta_fields(false)
             .with_option("hoodie.parquet.max.file.size", "1048576")
             .create()
diff --git a/crates/core/src/write/rewrite/lifecycle_tests.rs 
b/crates/core/src/write/rewrite/lifecycle_tests.rs
index da817ee3..0a89800b 100644
--- a/crates/core/src/write/rewrite/lifecycle_tests.rs
+++ b/crates/core/src/write/rewrite/lifecycle_tests.rs
@@ -254,7 +254,7 @@ async fn test_replace_verbs_exclude_log_only_mor_groups() {
             .with_record_key_fields(["id"])
             .with_partition_fields(["city"])
             .with_ordering_fields(["ts"])
-            .with_metadata(false)
+            .with_metadata_table_enabled(false)
             .create()
             .await
             .unwrap();
@@ -630,7 +630,7 @@ async fn 
test_rollback_fence_delete_failure_fails_the_write() {
         .with_record_key_fields(["id"])
         .with_partition_fields(["city"])
         .with_ordering_fields(["ts"])
-        .with_metadata(false)
+        .with_metadata_table_enabled(false)
         .create()
         .await
         .unwrap();
diff --git a/crates/core/tests/table_read_record_index_tests.rs 
b/crates/core/tests/table_read_record_index_tests.rs
index 8863814f..34dbff68 100644
--- a/crates/core/tests/table_read_record_index_tests.rs
+++ b/crates/core/tests/table_read_record_index_tests.rs
@@ -61,7 +61,7 @@ async fn three_groups(
         .with_table_name("t")
         .with_record_key_fields(["id"])
         .with_table_type(table_type)
-        .with_record_index(record_index)
+        .with_record_index_enabled(record_index)
         // One file group per append.
         .with_option("hoodie.parquet.small.file.limit", "0")
         .create()
@@ -343,7 +343,7 @@ async fn complex_three_groups(dir: &std::path::Path, 
version: isize) {
         .with_table_name("t")
         .with_table_version(version)
         .with_record_key_fields(["id"])
-        .with_record_index(true)
+        .with_record_index_enabled(true)
         .with_option("hoodie.parquet.small.file.limit", "0")
         .create()
         .await
@@ -440,7 +440,7 @@ async fn 
test_a_read_after_a_write_sees_a_commit_that_was_pending_at_open() {
     let mut table = Table::create(path)
         .with_table_name("t")
         .with_record_key_fields(["id"])
-        .with_record_index(true)
+        .with_record_index_enabled(true)
         .with_option("hoodie.parquet.small.file.limit", "0")
         .create()
         .await
diff --git a/crates/core/tests/table_read_runtime_tests.rs 
b/crates/core/tests/table_read_runtime_tests.rs
index 64753ac8..7f4dec9a 100644
--- a/crates/core/tests/table_read_runtime_tests.rs
+++ b/crates/core/tests/table_read_runtime_tests.rs
@@ -92,7 +92,7 @@ fn test_read_decodes_file_slices_off_the_calling_thread() {
         let mut table = Table::create(dir.path().to_str().unwrap())
             .with_table_name("trips")
             .with_record_key_fields(["id"])
-            .with_metadata(false)
+            .with_metadata_table_enabled(false)
             // One file group per append, so the read has several slices.
             .with_option("hoodie.parquet.small.file.limit", "0")
             .create()
diff --git a/crates/core/tests/table_write_archival_tests.rs 
b/crates/core/tests/table_write_archival_tests.rs
index 67617e8d..04ede12e 100644
--- a/crates/core/tests/table_write_archival_tests.rs
+++ b/crates/core/tests/table_write_archival_tests.rs
@@ -446,7 +446,7 @@ async fn plant_pending_then_archive(
         .with_record_key_fields(["id"])
         .with_partition_fields(["city"])
         // File listing then comes from storage, where the stray file is 
visible.
-        .with_metadata(false)
+        .with_metadata_table_enabled(false)
         .with_option("hoodie.keep.min.commits", "2")
         .with_option("hoodie.keep.max.commits", "3")
         .create()
diff --git a/crates/core/tests/table_write_composite_keys_tests.rs 
b/crates/core/tests/table_write_composite_keys_tests.rs
index b3bc02d2..73687f5f 100644
--- a/crates/core/tests/table_write_composite_keys_tests.rs
+++ b/crates/core/tests/table_write_composite_keys_tests.rs
@@ -119,7 +119,7 @@ async fn run_composite_key_lifecycle(table_type: 
TableTypeValue, record_index: b
         .with_table_name("web_returns")
         .with_table_type(table_type)
         .with_record_key_fields(KEY_FIELDS)
-        .with_record_index(record_index)
+        .with_record_index_enabled(record_index)
         .create()
         .await
         .unwrap();
@@ -239,7 +239,7 @@ async fn test_simple_index_tags_virtual_composite_keys() {
         .with_table_name("web_returns")
         .with_record_key_fields(KEY_FIELDS)
         .with_populates_meta_fields(false)
-        .with_record_index(false)
+        .with_record_index_enabled(false)
         .create()
         .await
         .unwrap();
diff --git a/crates/core/tests/table_write_lifecycle_tests.rs 
b/crates/core/tests/table_write_lifecycle_tests.rs
index 8d852052..936a599e 100644
--- a/crates/core/tests/table_write_lifecycle_tests.rs
+++ b/crates/core/tests/table_write_lifecycle_tests.rs
@@ -199,7 +199,7 @@ async fn 
test_cow_lifecycle_append_upsert_delete_overwrite_with_mdt() {
     let mut table = Table::create(base_uri)
         .with_table_name("trips")
         .with_record_key_fields(["id"])
-        .with_metadata(true)
+        .with_metadata_table_enabled(true)
         .create()
         .await
         .unwrap();
@@ -607,13 +607,13 @@ async fn test_record_index_requires_metadata() {
     let dir = tempdir().unwrap();
     let err = Table::create(dir.path().to_str().unwrap())
         .with_table_name("trips")
-        .with_metadata(false)
-        .with_record_index(true)
+        .with_metadata_table_enabled(false)
+        .with_record_index_enabled(true)
         .create()
         .await
         .unwrap_err();
     assert!(matches!(err, hudi_core::error::CoreError::Write(_)));
-    assert!(err.to_string().contains("record index requires"));
+    assert!(err.to_string().contains("record_index requires"));
 }
 
 /// A create that fails after writing `hoodie.properties` removes it, whichever
@@ -651,7 +651,7 @@ async fn test_record_index_off_falls_back_to_simple_index() 
{
     let mut table = Table::create(dir.path().to_str().unwrap())
         .with_table_name("trips")
         .with_record_key_fields(["id"])
-        .with_record_index(false)
+        .with_record_index_enabled(false)
         .create()
         .await
         .unwrap();
@@ -927,7 +927,7 @@ async fn test_cow_upsert_preserves_unrelated_file_groups() {
         .with_table_name("trips")
         .with_record_key_fields(["id"])
         .with_partition_fields(["city"])
-        .with_metadata(false)
+        .with_metadata_table_enabled(false)
         .with_option("hoodie.parquet.max.file.size", "1")
         .with_option("hoodie.copyonwrite.record.size.estimate", "1")
         .create()
diff --git a/crates/core/tests/table_write_model_tests.rs 
b/crates/core/tests/table_write_model_tests.rs
index b55a8966..5c0f6b39 100644
--- a/crates/core/tests/table_write_model_tests.rs
+++ b/crates/core/tests/table_write_model_tests.rs
@@ -256,7 +256,7 @@ async fn run_sequence(table_type: TableTypeValue, metadata: 
bool, seed: u64, ops
         .with_record_key_fields(["id"])
         .with_partition_fields(["city"])
         .with_ordering_fields(["ts"])
-        .with_metadata(metadata)
+        .with_metadata_table_enabled(metadata)
         .create()
         .await
         .unwrap();
diff --git a/crates/core/tests/table_write_tests.rs 
b/crates/core/tests/table_write_tests.rs
index 2ea7d518..de3e714d 100644
--- a/crates/core/tests/table_write_tests.rs
+++ b/crates/core/tests/table_write_tests.rs
@@ -187,7 +187,7 @@ async fn 
test_mdt_failure_before_commit_leaves_no_completed_data_instant() {
     let mut table = Table::create(root.to_str().unwrap())
         .with_table_name("trips")
         .with_record_key_fields(["id"])
-        .with_metadata(true)
+        .with_metadata_table_enabled(true)
         .create()
         .await
         .unwrap();
@@ -330,7 +330,7 @@ async fn 
test_create_rejects_managed_option_overrides_before_persisting() {
 }
 
 /// The Java writer's record index switch and its alternative key turn the
-/// record index on or off like `with_record_index`.
+/// record index on or off like `with_record_index_enabled`.
 #[tokio::test]
 async fn test_create_reads_java_record_index_switch() {
     const KEY: &str = "hoodie.metadata.global.record.level.index.enable";
@@ -345,7 +345,7 @@ async fn test_create_reads_java_record_index_switch() {
         let mut builder = Table::create(dir.path().to_str().unwrap())
             .with_table_name("trips")
             .with_record_key_fields(["id"])
-            .with_record_index(!enabled);
+            .with_record_index_enabled(!enabled);
         for (key, value) in &options {
             builder = builder.with_option(*key, *value);
         }
@@ -391,7 +391,7 @@ async fn 
test_create_with_metadata_and_append_updates_files_partition() {
     let mut table = Table::create(base_uri)
         .with_table_name("trips")
         .with_record_key_fields(["id"])
-        .with_metadata(true)
+        .with_metadata_table_enabled(true)
         .create()
         .await
         .unwrap();
@@ -1684,7 +1684,7 @@ async fn 
test_simple_index_first_upsert_inserts_every_key() {
             .with_table_name("trips")
             .with_table_type(table_type.clone())
             .with_record_key_fields(["id"])
-            .with_metadata(false)
+            .with_metadata_table_enabled(false)
             .create()
             .await
             .unwrap();
@@ -2081,7 +2081,7 @@ async fn 
test_simple_index_prefers_the_incoming_partition() {
             .with_table_name("trips")
             .with_record_key_fields(["id"])
             .with_partition_fields(["city"])
-            .with_metadata(false)
+            .with_metadata_table_enabled(false)
             .create()
             .await
             .unwrap();
@@ -2111,7 +2111,7 @@ async fn 
test_simple_index_prefers_the_incoming_partition() {
         .with_table_name("trips")
         .with_record_key_fields(["id"])
         .with_partition_fields(["city"])
-        .with_metadata(false)
+        .with_metadata_table_enabled(false)
         .create()
         .await
         .unwrap();
@@ -3142,21 +3142,21 @@ async fn 
test_create_builder_rejects_invalid_combinations() {
     let err = Table::create(dir.path().to_str().unwrap())
         .with_table_name("t")
         .with_record_key_fields(["id"])
-        .with_metadata(false)
-        .with_record_index(true)
+        .with_metadata_table_enabled(false)
+        .with_record_index_enabled(true)
         .create()
         .await
         .unwrap_err();
-    assert!(err.to_string().contains("record index requires"));
+    assert!(err.to_string().contains("record_index requires"));
 
     // column_stats without MDT.
     let dir = tempdir().unwrap();
     let err = Table::create(dir.path().to_str().unwrap())
         .with_table_name("t")
         .with_record_key_fields(["id"])
-        .with_metadata(false)
-        .with_record_index(false)
-        .with_column_stats(true)
+        .with_metadata_table_enabled(false)
+        .with_record_index_enabled(false)
+        .with_column_stats_enabled(true)
         .create()
         .await
         .unwrap_err();
@@ -3167,8 +3167,8 @@ async fn 
test_create_builder_rejects_invalid_combinations() {
     let err = Table::create(dir.path().to_str().unwrap())
         .with_table_name("t")
         .with_record_key_fields(["id"])
-        .with_column_stats(false)
-        .with_partition_stats(true)
+        .with_column_stats_enabled(false)
+        .with_partition_stats_enabled(true)
         .create()
         .await
         .unwrap_err();
@@ -4405,9 +4405,9 @@ async fn 
test_base_file_footer_omits_bloom_filter_without_meta_fields() {
     let dir = tempdir().unwrap();
     let mut table = Table::create(dir.path().to_str().unwrap())
         .with_table_name("trips")
-        .with_metadata(false)
-        .with_record_index(false)
-        .with_column_stats(false)
+        .with_metadata_table_enabled(false)
+        .with_record_index_enabled(false)
+        .with_column_stats_enabled(false)
         .with_populates_meta_fields(false)
         .create()
         .await
@@ -4531,7 +4531,7 @@ async fn 
test_delete_keys_removes_each_requested_partition_copy() {
             .with_table_type(table_type.clone())
             .with_record_key_fields(["id"])
             .with_partition_fields(["city"])
-            .with_metadata(false)
+            .with_metadata_table_enabled(false)
             .create()
             .await
             .unwrap();
diff --git a/python/hudi/_internal.pyi b/python/hudi/_internal.pyi
index 3536daa2..d1a8926c 100644
--- a/python/hudi/_internal.pyi
+++ b/python/hudi/_internal.pyi
@@ -465,10 +465,10 @@ class HudiTable:
         table_type: str = "cow",
         table_name: Optional[str] = None,
         table_version: Optional[int] = None,
-        record_index: Optional[bool] = None,
-        metadata_table: Optional[bool] = None,
-        column_stats: Optional[bool] = None,
-        partition_stats: Optional[bool] = None,
+        metadata_table_enabled: Optional[bool] = None,
+        record_index_enabled: Optional[bool] = None,
+        column_stats_enabled: Optional[bool] = None,
+        partition_stats_enabled: Optional[bool] = None,
         hive_style_partitioning: Optional[bool] = None,
         hudi_options: Optional[Dict[str, str]] = None,
         storage_options: Optional[Dict[str, str]] = None,
@@ -478,7 +478,7 @@ class HudiTable:
 
         Arguments left as ``None`` keep the native defaults: table version 9,
         metadata table on with the record index, column stats and partition
-        stats, and hive-style partition paths. Turning ``metadata_table`` off 
also
+        stats, and hive-style partition paths. Turning 
``metadata_table_enabled`` off also
         turns off the indexes that live in it.
 
         Parameters:
@@ -491,10 +491,10 @@ class HudiTable:
                 case-insensitive.
             table_name (Optional[str]): Defaults to the last path segment of 
``base_uri``.
             table_version (Optional[int]): Table version to write, 8 or 9.
-            record_index (Optional[bool]): Record-level index in the metadata 
table.
-            metadata_table (Optional[bool]): Metadata table.
-            column_stats (Optional[bool]): Column stats index in the metadata 
table.
-            partition_stats (Optional[bool]): Partition stats index in the 
metadata table.
+            metadata_table_enabled (Optional[bool]): Metadata table.
+            record_index_enabled (Optional[bool]): Record-level index in the 
metadata table.
+            column_stats_enabled (Optional[bool]): Column stats index in the 
metadata table.
+            partition_stats_enabled (Optional[bool]): Partition stats index in 
the metadata table.
             hive_style_partitioning (Optional[bool]): Use ``field=value`` 
partition paths.
             hudi_options (Optional[Dict[str, str]]): Extra ``hoodie.*`` table 
configs, written into
                 ``hoodie.properties``. Read options belong on the reader, not 
here.
diff --git a/python/src/internal.rs b/python/src/internal.rs
index 80de956c..eb35dd27 100644
--- a/python/src/internal.rs
+++ b/python/src/internal.rs
@@ -871,10 +871,10 @@ impl HudiTable {
         table_type="cow",
         table_name=None,
         table_version=None,
-        record_index=None,
-        metadata_table=None,
-        column_stats=None,
-        partition_stats=None,
+        metadata_table_enabled=None,
+        record_index_enabled=None,
+        column_stats_enabled=None,
+        partition_stats_enabled=None,
         hive_style_partitioning=None,
         hudi_options=None,
         storage_options=None,
@@ -889,10 +889,10 @@ impl HudiTable {
         table_type: &str,
         table_name: Option<String>,
         table_version: Option<isize>,
-        record_index: Option<bool>,
-        metadata_table: Option<bool>,
-        column_stats: Option<bool>,
-        partition_stats: Option<bool>,
+        metadata_table_enabled: Option<bool>,
+        record_index_enabled: Option<bool>,
+        column_stats_enabled: Option<bool>,
+        partition_stats_enabled: Option<bool>,
         hive_style_partitioning: Option<bool>,
         hudi_options: Option<HashMap<String, String>>,
         storage_options: Option<HashMap<String, String>>,
@@ -918,17 +918,17 @@ impl HudiTable {
         if let Some(version) = table_version {
             builder = builder.with_table_version(version);
         }
-        if let Some(enabled) = metadata_table {
-            builder = builder.with_metadata(enabled);
+        if let Some(enabled) = metadata_table_enabled {
+            builder = builder.with_metadata_table_enabled(enabled);
         }
-        if let Some(enabled) = record_index {
-            builder = builder.with_record_index(enabled);
+        if let Some(enabled) = record_index_enabled {
+            builder = builder.with_record_index_enabled(enabled);
         }
-        if let Some(enabled) = column_stats {
-            builder = builder.with_column_stats(enabled);
+        if let Some(enabled) = column_stats_enabled {
+            builder = builder.with_column_stats_enabled(enabled);
         }
-        if let Some(enabled) = partition_stats {
-            builder = builder.with_partition_stats(enabled);
+        if let Some(enabled) = partition_stats_enabled {
+            builder = builder.with_partition_stats_enabled(enabled);
         }
         if let Some(enabled) = hive_style_partitioning {
             builder = builder.with_hive_style_partitioning(enabled);
diff --git a/python/tests/test_table_write.py b/python/tests/test_table_write.py
index 2e3a14d9..6d34ac64 100644
--- a/python/tests/test_table_write.py
+++ b/python/tests/test_table_write.py
@@ -115,7 +115,7 @@ def test_create_with_explicit_options(tmp_path):
         partition_by=["city"],
         table_name="renamed",
         table_version=8,
-        metadata_table=False,
+        metadata_table_enabled=False,
         hive_style_partitioning=False,
         hudi_options={"hoodie.table.timeline.timezone": "UTC"},
     )
@@ -142,16 +142,19 @@ def test_create_on_existing_table_raises(tmp_path):
     "flags, error",
     [
         (
-            dict(metadata_table=False, record_index=True),
-            "record index requires the metadata",
+            dict(metadata_table_enabled=False, record_index_enabled=True),
+            "record_index requires the metadata",
         ),
         (
-            dict(metadata_table=False, column_stats=True),
+            dict(metadata_table_enabled=False, column_stats_enabled=True),
             "column_stats requires the metadata",
         ),
         # The explicit partition_stats choice is applied after column_stats,
         # so it is reported rather than silently turned off.
-        (dict(column_stats=False, partition_stats=True), "partition_stats 
requires"),
+        (
+            dict(column_stats_enabled=False, partition_stats_enabled=True),
+            "partition_stats requires",
+        ),
     ],
 )
 def test_create_rejects_inconsistent_index_options(tmp_path, flags, error):
@@ -166,9 +169,9 @@ def test_create_index_options(tmp_path):
         str(base),
         record_key="id",
         partition_by="city",
-        record_index=False,
-        column_stats=True,
-        partition_stats=False,
+        record_index_enabled=False,
+        column_stats_enabled=True,
+        partition_stats_enabled=False,
     )
     partitions = 
table.hudi_options()["hoodie.table.metadata.partitions"].split(",")
     assert "column_stats" in partitions

Reply via email to