refactor: optimize Table accessors and TimePoint passing - #414
Merged
Conversation
- Update `Table::location()` and `Table::metadata_file_location()` to return `std::string_view` instead of `const std::string&` to avoid unnecessary reference indirection. - Change `TimePointMs` and `TimePointNs` arguments and return types to pass-by-value in `Table` and utility functions, as they are small types. - Expose `Table::metadata()` accessor to allow access to the underlying table metadata. - Clean up unused variable declarations in `avro_schema_util.cc`.
Fokko
approved these changes
Dec 16, 2025
HuaHuaY
reviewed
Dec 16, 2025
| const auto& expected_value_field = map_type.value(); | ||
|
|
||
| FieldProjection result, key_projection, value_projection; | ||
| FieldProjection result; |
Contributor
There was a problem hiding this comment.
How about adding readability-isolate-declaration in .clang-tidy? We can do this in next PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Table::location()andTable::metadata_file_location()to returnstd::string_viewinstead ofconst std::string&to avoid unnecessary reference indirection.TimePointMsandTimePointNsarguments and return types to pass-by-value inTableand utility functions, as they are small types.Table::metadata()accessor to allow access to the underlying table metadata.avro_schema_util.cc.