question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Issue]: Issue with subsequence and defaults in Avro Schema

See original GitHub issue

Issue with subsequence and defaults in Avro Schema

Hey, I found a new strange behavior in an Avro schema. A minimal example for the Avro schema is attached. Note that there are two fields valueWithDefaults and valueWithoutDefaults, where one of them has a default value in type. If we use this Avro schema in the Value Schema Load Generator Config and use the field type seq to send a subsequence (let’s say [a,b,c]) the resulting Kafka message reads:

a -> b -> c for the case without defaults

However,

seq -> seq -> seq for the case with defaults (see in relevant log output).

I attached the minimal testplan and avro schema.

Again thanks in advance, Jonas

.jmx and .avsc were not supported 😅 issue.avsc.txt issue.jmx.txt

KloadGen Version

4.0.4

Relevant log output

genericRecord={"data": {"RecordArray": [{"valueWithDefaults": "seq", "valueWithoutDefaults": "a"}, {"valueWithDefaults": "seq", "valueWithoutDefaults": "b"}, {"valueWithDefaults": "seq", "valueWithoutDefaults": "c"}]}}

Have you added your JMX Testplan or a replica?

  • I have added a JMX testplan

Have you added your Schema or a replica?

  • I have added the Schema

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fcampostatocommented, Apr 12, 2022

Hi @JonasMueller1991,

We’ve being working on this today and we’ve uploaded a solution for this. You can check and try it on the #208-sequence-and-defaults branch.

We are still working on it, so it can take a little to be deployed to master. If you find any problems with the solution, please come back and we will try to help you.

Cheers!

0reactions
cmunozgomezcommented, Apr 18, 2022

hi @JonasMueller1991,

the pull request associated with this issue was integrated into the main branch, therefore this issue is closed.

Again, thank you very much for your collaboration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Avro validate defaults is hardcoded and set to false #1293
According to the Avro spec (https://avro.apache.org/docs/current/spec.html) the default value for a field must match the type of that field.
Read more >
Defaults for nested records in an Avro schema - Stack Overflow
You can only have null value as default value for nested objects in AVRO. This is how looks like the schema with default...
Read more >
[#AVRO-2879] Builder.build fails when enum has a default value
I would expect this schema to allow building an Avro Issue without providing a value for severity but it fails: { "protocol" :...
Read more >
Avro: unions & default values - ‍Federico Ragona
The answer is that the default value is ignored by Avro when encoding data and instead only used when decoding. To put it...
Read more >
Schema Evolution
Schema evolution is the term used for how the store behaves when Avro schema is changed after data has been written to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found