Inconsistent serialization behavior w.r.t java
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.1k
- Forks
- 232
- PR merge metrics
- No merged PRs in 30d
Description
Test code:
package main
import (
"fmt"
"github.com/linkedin/goavro"
)
func main() {
codec, err := goavro.NewCodec(`
{
"type": "record",
"name": "LongList",
"fields" : [
{"name": "foo", "type": "string", "default": "foo"},
{"name": "bar", "type": "string", "default": "bar"}
]
}`)
if err != nil {
fmt.Println(err)
}
// NOTE: May omit fields when using default value
textual := []byte(`{"foo":"foo"}`)
// Convert textual Avro data (in Avro JSON format) to native Go form
native, _, err := codec.NativeFromTextual(textual)
if err != nil {
fmt.Println(err)
}
print(native.(map[string]interface{})["bar"].(string))
}
This code prints bar.
Same test case with java avro-tools fails.
Contributor guide
No contributing guide indexed for this repository
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 with the supplied Go program, especially goavro.NewCodec and NativeFromTextual, using the shown schema and textual input. Compare its handling of the omitted bar field with java avro-tools; done means the implementations agree and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, java
- Domain
- data-engineering
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100