From d16e81e869defa0917aa957cd1d80befe20128e8 Mon Sep 17 00:00:00 2001 From: ZENOTME Date: Thu, 12 Dec 2024 14:17:48 +0800 Subject: [PATCH] expose _serde::DataFile --- crates/iceberg/src/spec/manifest.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/iceberg/src/spec/manifest.rs b/crates/iceberg/src/spec/manifest.rs index cad7221cf..39a061ef9 100644 --- a/crates/iceberg/src/spec/manifest.rs +++ b/crates/iceberg/src/spec/manifest.rs @@ -1227,6 +1227,8 @@ impl std::fmt::Display for DataFileFormat { } } +pub use _serde::DataFile as SerializedDataFile; + mod _serde { use std::collections::HashMap; @@ -1303,9 +1305,10 @@ mod _serde { } } + /// DataFile can used to be serialize. #[serde_as] #[derive(Serialize, Deserialize)] - pub(super) struct DataFile { + pub struct DataFile { #[serde(default)] content: i32, file_path: String, @@ -1329,6 +1332,7 @@ mod _serde { } impl DataFile { + /// Create a SerializedDataFile from a DataFile pub fn try_from( value: super::DataFile, partition_type: &StructType, @@ -1358,6 +1362,8 @@ mod _serde { sort_order_id: value.sort_order_id, }) } + + /// Convert a SerializedDataFile to a DataFile pub fn try_into( self, partition_type: &StructType,