Feature request: Add a method to get specificRecord from genericRecord
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 87
- Forks
- 73
- Avg merge
- 2h 50m
- Merged PRs (30d)
- 1
Description
As in title, I am looking for a util method with signature as:
import org.apache.avro.generic.GenericRecord;
import org.apache.avro.specific.SpecificRecord;
public static <T extends SpecificRecord> T genericToSpecificRecord(GenericRecord genericRecord, Class<T> specificClass);
Expected behavior:
- The conversion tries to match the field schemas, by name and type typically, of the generic and specific records.
- The method should work for nested IndexedRecord cases.
- The method should work in any Avro version (if impossible, try the way with the least limitation).
Thank you.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating existing utilities and tests for GenericRecord, SpecificRecord, and IndexedRecord in the repository. Use the requested genericToSpecificRecord signature and its field-matching, nested-record, and cross-version requirements as the acceptance criteria. The issue names no implementation files or tests, so the compatibility constraints require substantial repository and Avro-version research.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100