Skip to content

Support different header types - #190

Merged
martin-g merged 8 commits into
apache:mainfrom
masongup:support-different-header-types
Apr 28, 2025
Merged

martin-g merged 8 commits into
apache:mainfrom
masongup:support-different-header-types

Conversation

@masongup-mdsol

Copy link
Copy Markdown
Contributor

Addresses #164

I didn't get any response when I asked about preferred designs, so I went ahead and created one that seemed reasonable to me.

I created a new Header module with a HeaderBuilder trait, then reimplemented the existing Rabin fingerprint header as a struct impling this trait, and also another one with the Glue schema header type that I used. This design should be sufficiently generic to allow for the future implementation of more header types.

I also added a new method to the GenericSingleObjectReader and GenericSingleObjectWriter to allow the creation of each object type with a HeaderBuilder instance. I then modified the existing creator methods to keep the same signature but call these new methods with the RabinFingerprintHeader struct to maintain the current behavior, and I added a couple of new tests to exercise the functionality.

Comment thread avro/src/headers.rs Resolved
Comment thread avro/src/headers.rs Resolved
Comment thread avro/src/headers.rs Resolved
Comment thread avro/src/reader.rs Resolved
Comment thread avro/src/headers.rs Resolved
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Comment thread avro/src/headers.rs Resolved
masongup-mdsol and others added 3 commits April 28, 2025 16:25
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
@martin-g
martin-g merged commit 4e18975 into apache:main Apr 28, 2025
@martin-g

Copy link
Copy Markdown
Member

Thank you for the contribution, @masongup-mdsol !

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.

2 participants