William Pickett created AVRO-2825:
-------------------------------------
Summary: C# Logical Types throw exception on unknown logical type
Key: AVRO-2825
URL: https://issues.apache.org/jira/browse/AVRO-2825
Project: Apache Avro
Issue Type: Bug
Components: csharp
Affects Versions: 1.9.2
Reporter: William Pickett
In the C# avro implementation of logical types, the logical type functionality
throws an exception whenever the an unknown logical type is used. The
LogicalTypeFacory implements a boolean to ignore this exception, however, the
calling function forces the exception to be thrown.
LogicalSchema calling function:
[https://github.com/apache/avro/blob/75e8f58c95e2b8c69af1a6f60c35a848a6781f0c/lang/csharp/src/apache/main/Schema/LogicalSchema.cs#L58]
LogicalTypeFactory:
[https://github.com/apache/avro/blob/8199b9626e4badd34a85946cd223a91863f44cee/lang/csharp/src/apache/main/Util/LogicalTypeFactory.cs]
According to the AVRO spec:
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.
([https://avro.apache.org/docs/1.9.2/spec.html#Logical+Types])
So this functionality should not throw an exception when encountering an
unknown type and instead use the underlying type.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)