Avro 1.9+ dropping defaults
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
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 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