linkedin / linkedin/goavro

Getting a single binary-encoded object [OCFReader.ReadBinary() function?]

Open
#108 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
1.1k
Forks
232
PR merge metrics
No merged PRs in 30d

Description

I'd like to be able to take an OCF as input, then pull out individual binary-encoded objects one at a time. I will store the schema separately and later apply it to these individual objects using Codec.NativeFromBinary.

I can currently use OCFReader.Scan/Read and Codec.BinaryFromNative to get a single binary-encoded object, but the call to OCFReader.Read invokes Codec.NativeFromBinary. Because performance is an important consideration in this, I'd like to be able to skip those redundant decoding/encoding calls.

Ideally, something like OCFReader.ReadBinary() would return a []byte containing exactly one Avro object. I'm trying to implement it, but being unfamiliar with goavro I'm having a hard time figuring out if I can generically pull out the slice of bytes representing a single object without basically reimplementing nativeFromBinary functions for each Avro type. Any suggestions?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing OCFReader.Scan and Read alongside Codec.NativeFromBinary and Codec.BinaryFromNative to understand where individual object boundaries are available. The change is complete when an OCF reader can return each object as its original []byte without redundant native decoding and re-encoding, while preserving the existing read behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.