Skip to content

Commit

Permalink
expose _serde::DataFile
Browse files Browse the repository at this point in the history
  • Loading branch information
ZENOTME committed Dec 12, 2024
1 parent 26503de commit d16e81e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/iceberg/src/spec/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,8 @@ impl std::fmt::Display for DataFileFormat {
}
}

pub use _serde::DataFile as SerializedDataFile;

mod _serde {
use std::collections::HashMap;

Expand Down Expand Up @@ -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,
Expand All @@ -1329,6 +1332,7 @@ mod _serde {
}

impl DataFile {
/// Create a SerializedDataFile from a DataFile
pub fn try_from(
value: super::DataFile,
partition_type: &StructType,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d16e81e

Please sign in to comment.