We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For the following Avro schema
{ "type": "record", "name": "Item", "fields": [ { "name": "foo", "type": [ "null", "string" ], "default": null }, { "name": "bar", "type": [ "string", "null" ], "default": "null" }, { "name": "baz", "type": [ "string", "null" ], "default": "abcd" } ] }
avrohugger generates the following case class:
final case class Item( var foo: Option[String] = None, var bar: Option[String] = None, var baz: Option[String] = Some("abcd") ) extends org.apache.avro.specific.SpecificRecordBase ...
The default values for foo and baz are correct. However, the default value for bar should be Some("null"), not None.
foo
baz
bar
Some("null")
None
The text was updated successfully, but these errors were encountered:
Expected, as the default value of a union corresponds to its first element, see this answer: https://stackoverflow.com/a/23387590/1571826
Sorry, something went wrong.
@nicodv, no, this is not expected. The first type of the union for "bar" is string, so the default value should be string as well.
My bad, was looking at “foo”.
No branches or pull requests
For the following Avro schema
avrohugger generates the following case class:
The default values for
foo
andbaz
are correct.However, the default value for
bar
should beSome("null")
, notNone
.The text was updated successfully, but these errors were encountered: