[
https://issues.apache.org/jira/browse/AVRO-2359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17035712#comment-17035712
]
David Simons edited comment on AVRO-2359 at 2/12/20 9:12 PM:
-------------------------------------------------------------
I've been working with the initial MR for Logical Types and notice that as
written the code doesn't support the following form of fixed decimal
{code:java}
{
"name": "decimal_9",
"type": "fixed",
"size": 4,
"logicalType": "decimal",
"precision": 9,
"scale": 2"
}
{code}
The exception is currently:
Avro.Test.LogicalTypeTests.TestFixedDecimal("-000000000000000001.01")
Avro.SchemaParseException : Undefined name: fixed at 'type'
at Avro.Schema.ParseJson(JToken jtok, SchemaNames names, String encspace) in
C:\src\GitHub\avro\lang\csharp\src\apache\main\Schema\Schema.cs:line 174
at Avro.LogicalSchema.NewInstance(JToken jtok, PropertyMap props, SchemaNames
names, String encspace) in
C:\src\GitHub\avro\lang\csharp\src\apache\main\Schema\LogicalSchema.cs:line 50
at Avro.Schema.ParseJson(JToken jtok, SchemaNames names, String encspace) in
C:\src\GitHub\avro\lang\csharp\src\apache\main\Schema\Schema.cs:line 196
at Avro.Schema.Parse(String json, SchemaNames names, String encspace) in
C:\src\GitHub\avro\lang\csharp\src\apache\main\Schema\Schema.cs:line 253
at Avro.Schema.Parse(String json) in
C:\src\GitHub\avro\lang\csharp\src\apache\main\Schema\Schema.cs:line 219
at Avro.Test.LogicalTypeTests.TestFixedDecimal(String s) in
C:\src\GitHub\avro\lang\csharp\src\apache\test\Util\LogicalTypeTests.cs:line 55.
The usage of the above scenario is very powerfull if implementations, where you
have hundreds of uses of decimal values where you want them to all, support the
same specification. I'm still looking at the code to understand what the best
answer would be but it would need to be some form of named logical scheme.
was (Author: davidjsimonsttd):
I've been working with the initial MR for Logical Types and notice that as
written the code doesn't support the following form of fixed decimal
{code:java}
{
"name": "decimal_9",
"type": "fixed",
"size": 4,
"logicalType": "decimal",
"precision": 9,
"scale": 2"
}
{code}
The usage of the above scenario is very powerfull if implementations, where you
have hundreds of uses of decimal values where you want them to all, support the
same specification. I'm still looking at the code to understand what the best
answer would be but it would need to be some form of named logical scheme.
> Support Logical Types in C#
> ---------------------------
>
> Key: AVRO-2359
> URL: https://issues.apache.org/jira/browse/AVRO-2359
> Project: Apache Avro
> Issue Type: New Feature
> Components: csharp
> Affects Versions: 1.8.2
> Reporter: Tim Roberts
> Priority: Critical
>
> By not supporting Logical Types, the C# Avro implementation is severely
> limited in terms of its interoperability in heterogeneous environments. While
> the implementation will safely ignore logical type declarations in processed
> schemas; at runtime the semantics of a "date" for example, will be lost when
> receiving an Avro payload that was encoded by the Java platform using the
> same schema. The C# implementation will never be able to retrieve the date
> value from the encoded int.
> I propose that the C# Avro implementation be extended to support the Logical
> Types as defined by the current specification. I have also explored the
> lang/csharp codebase and believe that I could produce a PR to support this.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)