-
Notifications
You must be signed in to change notification settings - Fork 545
Reflection-based protobuf
parser only returns single component
#11459
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
Add Arrow extension metadata
Web viewer built successfully.
Note: This comment is updated whenever you push a commit. |
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.
Pull Request Overview
This PR refactors the protobuf reflection parser to consolidate protobuf messages into a single component instead of splitting them into multiple field-based components. This simplifies data extraction from lenses and ensures each protobuf message remains self-contained.
- Changed from field-based component structure to single message component
- Modified parser to use a single StructBuilder wrapped in a FixedSizeListBuilder
- Updated component naming from individual fields to a unified "message" component
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
crates/utils/re_mcap/src/layers/protobuf.rs | Core refactoring of protobuf parser from field-based to message-based structure |
crates/utils/re_mcap/src/layers/snapshots/re_mcap__layers__protobuf__test__two_simple_rows.snap | Updated test snapshot reflecting new single-component output format |
Comments suppressed due to low confidence (1)
crates/utils/re_mcap/src/layers/protobuf.rs:1
- [nitpick] This function uses a long chain of if-else statements that could be simplified using a match-based approach or a trait-based solution. Consider extracting this logic into a trait implementation for ArrayBuilder types or using a macro to reduce code duplication.
use arrow::{
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
protobuf
parser only returns single component
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.
very nice!
}) | ||
} | ||
|
||
fn append_null_to_builder(builder: &mut dyn ArrayBuilder) -> Result<(), ProtobufError> { |
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.
would be nice if ArrayBuilder
implemented append_null
🥲
) ### Related * Closes RR-2552. * Related to RR-2553. * Related to #11394. * [x] Requires #11458. ### What This changes our `protobuf` reflection code to put the entire message behind a single component to make it easier to extract it from lenses. This also guarantees that each protobuf message is always self-contained.
Related
Lens
as a concept for semantic mapping of arbitrary data #11394.protobuf
messages asStructArray
#11458.What
This changes our
protobuf
reflection code to put the entire message behind a single component to make it easier to extract it from lenses. This also guarantees that each protobuf message is always self-contained.