AvroConvert icon indicating copy to clipboard operation
AvroConvert copied to clipboard

How to serialize multiple objects into one avro?

Open ChristianSauer opened this issue 1 year ago • 3 comments

I have a range of objects I want to serialize into one avro - since I need to match the Azure Eventhub Schema I need to store an object per Record. Unfortunately, it seems the API is able to do so? AvroConvert.Serialize accepts only a single object, and while merge could to the job, its serious overhead for the number of objects I have. I considered using encoder directly, but sadly that class is internal.

ChristianSauer avatar Jun 19 '24 11:06 ChristianSauer

Hey, Please take a look at the PR: https://github.com/AdrianStrugala/AvroConvert/pull/119 Would the proposed serialization be solution to your problem? Adrian

AdrianStrugala avatar Jun 23 '24 19:06 AdrianStrugala

Does it serialize into rows? I'm unsure by looking at the PR.

ChristianSauer avatar Jun 28 '24 12:06 ChristianSauer

Hey, Please take a look at the PR: #119 Would the proposed serialization be solution to your problem? Adrian

I had a similar issue with AvroConvert.Serialize serializing an IEnumerable<T> into a single array record, as opposed to multiple records with schemas inferred from T. PR #119 did indeed solve for my use-case. I am looking forward to a v4 release to see a similar implementation deployed.

JLysberg avatar Jul 31 '24 19:07 JLysberg

Closing as #118 duplicate

AdrianStrugala avatar Apr 18 '25 07:04 AdrianStrugala