linkedin / linkedin/goavro

Question: Record "com.epiphany.avro.data" field "thumbnailUrl": default value ought to encode using field schema: cannot encode binary bytes: expected: string; received: <nil>]

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

Nobody has claimed this yet.

Dominant language
Go
Stars
1.1k
Forks
232
PR merge metrics
No merged PRs in 30d

Description

I have 3 optional "string" data elements within my json, the following excerpt shows these fields from AVRO schema defines, during compilation I receive " cannot encode binary bytes: expected: string; received: ". I'm unsure how these field should be defined:
CODE:
codec, err := goavro.NewCodec(EntityMap.Schema)
if err != nil {
logger.Warning("schemaID=" + EntityMap.GUID + " " + err.Error())
return err
}
_, _, err = codec.NativeFromTextual(message)
if err != nil {
logger.Warning("schemaID=" + EntityMap.GUID + " " + err.Error())
return err
}
AVRO:
{
"name": "thumbnailUrl",
"type": ["null", "string"],
"default": null
},

{
"name": "shortDescription",
"type": ["null", "string"],
"default": null
},

{
"name": "longDescription",
"type": ["null", "string"],
"default": null
},

Contributor guide

No contributing guide indexed for this repository

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 goavro.NewCodec and codec.NativeFromTextual, using the reported Avro union fields and nil values as the reproduction. Trace how optional string defaults are interpreted during textual conversion; done means determining the valid representation or confirming a library change is required for these fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
data-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.