iceberg-rust
iceberg-rust copied to clipboard
Avoid clone in TableMetadata Serialization
When we serialize the TableMetadata, we convert it into type TableMetadataEnum.
Since fn serialize takes &self and fn from(value) takes the ownership, we must do a clone.
I am unsure how it affects the performance, but it may be a concern. Ideally, we may directly serialize it into metadata V1/V2 to avoid the copy conversion.
I agree that this may be a little wasteful, but the cost maybe small: the heavy ones are hold by Arc. We can do this optimization when necessary.