Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3570

Logical type with "fixed" type not interoperable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.11.0
    • None
    • csharp, doc, logical types, rust
    • None

    Description

      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:

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

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

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

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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kniemitalo Kalle Niemitalo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: