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

yuxia pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss-rust.git


The following commit(s) were added to refs/heads/main by this push:
     new 594adc6  chore: align DataLakeFormat parsing with lake format config 
option (#306)
594adc6 is described below

commit 594adc60dd00dbac08b612bf0c1b45946a94fa4f
Author: Junfan Zhang <[email protected]>
AuthorDate: Fri Feb 13 11:50:59 2026 +0800

    chore: align DataLakeFormat parsing with lake format config option (#306)
---
 crates/fluss/src/metadata/data_lake_format.rs | 37 ++++++++++++++++++++++++---
 1 file changed, 34 insertions(+), 3 deletions(-)

diff --git a/crates/fluss/src/metadata/data_lake_format.rs 
b/crates/fluss/src/metadata/data_lake_format.rs
index c186109..b0c3b0d 100644
--- a/crates/fluss/src/metadata/data_lake_format.rs
+++ b/crates/fluss/src/metadata/data_lake_format.rs
@@ -23,11 +23,42 @@ use strum_macros::{Display, EnumString};
 /// between different table formats so that the appropriate integration and
 /// semantics can be applied.
 #[derive(Debug, EnumString, Display, PartialEq)]
+#[strum(ascii_case_insensitive)]
 pub enum DataLakeFormat {
-    /// Apache Paimon data lake table format.
+    #[strum(serialize = "paimon")]
     Paimon,
-    /// Lance columnar data format / lakehouse table format.
+
+    #[strum(serialize = "lance")]
     Lance,
-    /// Apache Iceberg data lake table format.
+
+    #[strum(serialize = "iceberg")]
     Iceberg,
 }
+
+#[cfg(test)]
+mod tests {
+    use crate::metadata::DataLakeFormat;
+    use crate::metadata::DataLakeFormat::{Iceberg, Lance, Paimon};
+
+    #[test]
+    fn test_parse() {
+        let cases = vec![
+            ("paimon", Paimon),
+            ("Paimon", Paimon),
+            ("PAIMON", Paimon),
+            ("lance", Lance),
+            ("LANCE", Lance),
+            ("iceberg", Iceberg),
+            ("ICEBERG", Iceberg),
+        ];
+
+        for (raw, expected) in cases {
+            let parsed = raw.parse::<DataLakeFormat>().unwrap();
+            assert_eq!(parsed, expected, "failed to parse: {}", raw);
+        }
+
+        // negative cases
+        assert!("unknown".parse::<DataLakeFormat>().is_err());
+        assert!("".parse::<DataLakeFormat>().is_err());
+    }
+}

Reply via email to