Skip to content

Design of Serialization/Deserialization #2

Closed

Description

@JanKaul

I would like to have a discussion about how to implement the Serialization/Deserialization of the iceberg metadata. There are currently two different designs each with its pros and cons. The designs are:

  1. Split representation into in_memory/on_disk part (example)
  2. Use custom implementations of Serialize/Deserialize (example)

I would like to get your opinion which design you prefer.

Activity

  1. ZENOTME commented on Jul 21, 2023

    @ZENOTME
    Contributor

    If I'm not mistaken, use the split representation also need to custom implementation for on_disk part. And we should maintain two system: in_memory::type, in_memory::value, on_disk::type, on_disk::value. And we also need to maintain the conversion between in_memory and on_disk. So I think strictly separate two part may cause redundant code. Can we only separate some part🤔?

  2. JanKaul commented on Jul 21, 2023

    @JanKaul
    CollaboratorAuthor

    I also think that a split representation leads to redundancy which makes maintaining the code more difficult.

    I personally think that the added complexity of custom implementations of Serialize/Deserialize is worth avoiding the redundancy.

  3. JanKaul commented on Jul 21, 2023

    @JanKaul
    CollaboratorAuthor

    I realized that this discussion is closely related to #3 , because it gives additional motivation for splitting the representation into an in_memory and on_disk part.

    I think @ZENOTME made a good point about splitting only a part of the spec.

    We could split the representation for all structs that have user interaction (i.e. TableMetadata) but use a single representation for the smaller building blocks (i.e. types, values, ..)

  4. liurenjie1024 commented on Jul 21, 2023

    @liurenjie1024
    Contributor

    Personally, I prefer the Serialize/Deserialize approach. From my experience, the effort doesn't reduce much since both way you need to maintain the conversion logic. The on_disk approach has some shorting comings:

    1. It's not easy to be comptaible with both v1 and v2 spec. See this pr, I have to remove v1 support since avro has strict schema check.
    2. Sometimes we still need to write the serializaer, see https://github.com/liurenjie1024/icelake/blob/eee3520f993837f4e1745c60538ba7ab1b421481/src/types/in_memory.rs#L64
      https://github.com/icelake-io/icelake/blob/eee3520f993837f4e1745c60538ba7ab1b421481/src/types/in_memory.rs#L64
  5. ZENOTME commented on Jul 21, 2023

    @ZENOTME
    Contributor

    We could split the representation for all structs that have user interaction (i.e. TableMetadata) but use a single representation for the smaller building blocks (i.e. types, values, ..)

    Sounds good for me.

  6. Xuanwo commented on Jul 21, 2023

    @Xuanwo
    Member

    Ok, let's pick the Serialize/Deserialize approach.

    We could split the representation for all structs that have user interaction (i.e. TableMetadata) but use a single representation for the smaller building blocks (i.e. types, values, ..)

    Nice idea!

  7. liurenjie1024 commented on Dec 14, 2023

    @liurenjie1024
    Contributor

    Close this as we have finished discussion. Feel free to open if needed.

  8. added a commit that references this issue on Nov 20, 2025
  9. added a commit that references this issue on Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions