flavray/avro-rs

Incorrect logical type implementation according to specification

cpcloud opened this issue · 1 comments

The spec says that unknown or invalid logical types should be ignored when reading and that instead the underlying type should be used:

Language implementations must ignore unknown logical types when reading, and should use the underlying Avro type. If a logical type is invalid, for example a decimal with scale greater than its precision, then implementations should ignore the logical type and use the underlying Avro type.

The current implementation does not respect this and will return an error in cases such as a decimal scale being greater than its precision.

The spec says Scale must be zero or a positive integer less than or equal to the precision..
The Java impl also throws an exception for this case - https://github.com/apache/avro/blob/5eff9a7f503ab0de550c99b6b46ac628ca9d817d/lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java#L289-L292