linkedin / linkedin/avro-util

Avro 1.9+ dropping defaults

Open
#298 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The helper builder drops the default value if the default value type does not match, eg if 0 is a default value of field type float then the following code will silently drop the default

public FieldBuilder19(Schema.Field other) {
if (other != null) {
_name = other.name();
_schema = other.schema();
_doc = other.doc();
_defaultVal = other.defaultVal(); // Its null for Avro 1.9+
_order = other.order(); // other.order() cannot be null under Avro 1.9.*
_props = other.getObjectProps();
}
}

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 at the FieldBuilder19(Schema.Field other) constructor shown in the issue and inspect how Avro 1.9+ exposes default values for fields whose value type differs from the schema type. Reproduce the float-field case with a default of 0, then verify that the default is preserved rather than silently becoming null.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.