ZENOTME commented on code in PR #406: URL: https://github.com/apache/iceberg-rust/pull/406#discussion_r1641901794
########## crates/iceberg/src/spec/values.rs: ########## @@ -105,6 +108,115 @@ pub struct Datum { literal: PrimitiveLiteral, } +impl Serialize for Datum { + fn serialize<S: serde::Serializer>( + &self, + serializer: S, + ) -> std::result::Result<S::Ok, S::Error> { + let mut strucet_ser = serializer + .serialize_struct("Datum", 2) + .map_err(serde::ser::Error::custom)?; + strucet_ser + .serialize_field("type", &self.r#type) + .map_err(serde::ser::Error::custom)?; + strucet_ser + .serialize_field( + "literal", + &RawLiteral::try_from( Review Comment: One thing may not related this PR. https://github.com/apache/iceberg-rust/blob/806840729c1dd886624f6ce3cb132d0912befb4b/crates/iceberg/src/spec/manifest.rs#L954 I find that for de/serialize, we need the type info. Maybe using Struct with StructType here is more appropriate. (For now, Datum doesn't support Struct). So that we can convert it between RawLiteral directly. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org