-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
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
Can't specify default values for LogicalType: "decimal" fields #202
Comments
rockwotj
added a commit
to rockwotj/goavro
that referenced
this issue
Dec 17, 2024
rockwotj
added a commit
to rockwotj/goavro
that referenced
this issue
Dec 18, 2024
rockwotj
added a commit
to rockwotj/goavro
that referenced
this issue
Dec 18, 2024
Unlike timestamp types which accepts native values, decimal types must be big.Rat, which means defaults need to be converted. This fixes: linkedin#202
rockwotj
added a commit
to rockwotj/goavro
that referenced
this issue
Jan 10, 2025
Unlike timestamp types which accepts native values, decimal types must be big.Rat, which means defaults need to be converted. This fixes: linkedin#202
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Similar issue to #198
For any field with logicalType decimals, setting a default value, throws an error.
default value ought to encode using field schema...
The test fails with Record "schema" field 1 ought to be valid Avro named type: Union item 2 ought to be valid Avro type: Record "*" field "price": default value ought to encode using field schema: cannot transform to bytes, expected *big.Rat, received string
Even if you try to change the schema to have a default type of *big.Rat there is no way to achieve this as the value will never get interpreted as a *big.Int. However, the Avro schema shouldn't have to work with a specific GO type it should be able to handle a default value specified in the same way as a normal avro decimal field.
The text was updated successfully, but these errors were encountered: