linkedin / linkedin/avro-util

[feature request] Add Avro agnostic API to make deep copies of a field value.

Open
#270 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement helper
Dominant language
Java
Stars
87
Forks
73
Avg merge
2h 50m
Merged PRs (30d)
1

Description

I have encountered a situation where I need to make deep copies of a field's default value:

```
Object curFieldDefaultValue = GenericData.get().deepCopy(currField.schema(), GenericData.get().getDefaultValue(currField));
```

An Avro agnostic API here would be nice.

From @radai-rosenblatt:
`since the helper supports fetching defaults as either generic or specific "forms", i guess the deep copy functionality would need to support both as well`

Contributor guide

Open the contributing guide

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 with the shown GenericData.deepCopy and GenericData.getDefaultValue calls, then examine how the helper exposes generic and specific default forms. Done means an Avro-agnostic API supports deep-copying a field's default value in both forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.