[Issue]: Issue with subsequence and defaults in Avro Schema
See original GitHub issueIssue 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:
- Created a year ago
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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!
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.