Skip to content

Conversation

@wgtmac
Copy link
Member

@wgtmac wgtmac commented Apr 14, 2025

No description provided.

@wgtmac wgtmac force-pushed the table-meta-serde branch 2 times, most recently from 6acbdc6 to 2d55ea2 Compare April 15, 2025 04:05
@wgtmac wgtmac marked this pull request as ready for review April 15, 2025 04:06
@wgtmac
Copy link
Member Author

wgtmac commented Apr 15, 2025

@lidavidm @zhjwpku @gty404 Could you help review this?

I will add test cases once #74 has been merged.

Note that I have removed Formatable inheritance to facilitate aggregate initialization of simple structs and add ToString functions instead.

}
};

/// \brief Returns a string representation of a BlobMetadata
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name may need to use BlobMetadataToString to avoid conflicts with the ToString method in member methods ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed ToString member function because inheritance prohibits aggregate initialization.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM. We could extend the std::format specialization to look for an overload of iceberg::ToString or something (or try argument-dependent lookup? 🤔)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we can specialize std::formatter in the iceberg/util/formatter.h for classes that have iceberg::ToString(const T&) at hands.

}
};

/// \brief Returns a string representation of a BlobMetadata
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM. We could extend the std::format specialization to look for an overload of iceberg::ToString or something (or try argument-dependent lookup? 🤔)

Copy link
Collaborator

@zhjwpku zhjwpku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wgtmac wgtmac force-pushed the table-meta-serde branch from 2d55ea2 to 1f4447a Compare April 16, 2025 02:06
@wgtmac wgtmac force-pushed the table-meta-serde branch from 1f4447a to 45514cf Compare April 16, 2025 02:09
Copy link
Contributor

@gty404 gty404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wgtmac Thanks for raising this PR, this looks great already! How do you feel about adding some tests?

We have some example JSONs here: https://github.com/apache/iceberg/tree/main/core/src/test/resources

@wgtmac
Copy link
Member Author

wgtmac commented Apr 17, 2025

Thanks @Fokko for the view! I will add test cases in a separate PR. Otherwise @zhjwpku might have a headache to rewrite a lot of test cases when working on this issue: #79

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wgtmac Sounds good to me 👍 Thanks for working on this, this looks great!

@Fokko Fokko merged commit 9c74fd2 into apache:main Apr 17, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants