-
Notifications
You must be signed in to change notification settings - Fork 70
test: add table metadata deserialization test #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
wgtmac
commented
Apr 18, 2025
- Added a set of test files from https://github.com/apache/iceberg/tree/main/core/src/test/resources
- Fixed table metadata deserialization
- Added singleton for unsorted sort order and unpartitioned spec
- Added test case for deserializing valid v1 and v2 metadata files
0bd62f2 to
098e848
Compare
098e848 to
9c096d6
Compare
zhjwpku
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/iceberg/table_metadata.cc
Outdated
| } | ||
|
|
||
| const std::shared_ptr<Schema>& TableMetadata::Schema() const { | ||
| static const std::shared_ptr<::iceberg::Schema> empty_schema = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not return a truly empty schema object, but null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I once had the same concern, but this method returns a reference, I guess that's the reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switched to wrap the return in a Result so we can get an explicit NotFound error.
Fokko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @wgtmac, thanks for adding these test-cases 👍
| rev: v19.1.5 | ||
| hooks: | ||
| - id: clang-format | ||
| exclude: ^test/resources/.*\.json$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does clang want to format json? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, without this change the pre-commit fails and complains that clang-format does not support JSON file.
Xuanwo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The community has reached a consensus. Let's move forward!