You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Kalle Niemitalo (Jira)" <ji...@apache.org> on 2022/07/03 15:49:00 UTC

[jira] [Created] (AVRO-3570) Logical type with "fixed" schema not interoperable

Kalle Niemitalo created AVRO-3570:
-------------------------------------

             Summary: Logical type with "fixed" schema not interoperable
                 Key: AVRO-3570
                 URL: https://issues.apache.org/jira/browse/AVRO-3570
             Project: Apache Avro
          Issue Type: Bug
          Components: csharp, doc, rust
    Affects Versions: 1.11.0
            Reporter: Kalle Niemitalo


The Avro specification does not include examples on how to apply the "decimal" or "duration" logical type to a "fixed" type. The implementations disagree on what the correct JSON structure is.

The C++, Java, Python, and Ruby libraries expect the properties of the "fixed" type to be in the same JSON object as the properties of the logical type:

{code:JSON}
{
    "type": "fixed",
    "name": "test.FixedDecimal",
    "size": 8,
    "logicalType": "decimal",
    "precision": 18,
    "scale": 4
}
{code}

The C# and Rust libraries instead expect a nested JSON object for the "fixed" type:

{code:JSON}
{
    "type": {
        "type": "fixed",
        "name": "test.Fixed8",
        "size": 8
    },
    "logicalType": "decimal",
    "precision": 18,
    "scale": 4
}
{code}

Schemas using types like this are then not interoperable between languages.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)