-
Notifications
You must be signed in to change notification settings - Fork 98
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
CLI: mcap filter subcommand #445
Conversation
5ce6425
to
7c6adc8
Compare
7c6adc8
to
e274d65
Compare
There was a bug where WriteAttachmentIndex would fail to pre-allocate 8 bytes for one of its uint64 timestamp fields. This would cause the write buffer to be too short to fit the final field (the content type string). In our existing test cases, the content type was more than 8 chars long, and the effect was to truncate the content type string by 8 chars. However, in implementing `mcap filter`, i created a test case with a 0-length content type string, which caused a segfault.
bad50ee
to
78204b6
Compare
78204b6
to
891a079
Compare
This subcommand allows command-line users to filter MCAP files by time range and topic name.
891a079
to
d14ef51
Compare
What is the syntax for filter? Some examples? |
@defunctzombie from the long help:
Some more examples:
|
} | ||
} else { | ||
channels[channel.ID] = markableChannel{channel, false} | ||
} |
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.
if we write the schema+channel after observing the channel, rather than after observing the first message, would that let us drop the "markable" aspect of the channel map, or maybe even drop the channel map altogether?
That would also result in us returning channels with matching topics even if they have no messages on them, which seems more correct on balance to me. What do you think?
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.
IMO a channel with no messages in it in an MCAP does not make a lot of sense to me, which is why I did it this way.
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.
well, a channel in an mcap with no messages is definitely something you can record - so why wouldn't the filter command preserve channels on the supplied topic?
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.
few high-level comments - feel free to address as you like. I pulled it down and tested, seems to work fine with the stdout change.
Public-Facing Changes
mcap filter
subcommand added, which you can use to filter MCAPs by topic and time range.content type to be malformed.
Description
This PR adds a new subcommand to the MCAP CLI tool that allows people to quickly filter topics into and out-of an MCAP file.