Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which version of the Avro specification does the latest version of avsc (5.7.7) implement? #459

Open
fergalmonaghan opened this issue Apr 25, 2024 · 3 comments
Labels

Comments

@fergalmonaghan
Copy link

The Wiki docs here https://github.com/mtth/avsc/wiki currently say:

avsc is a pure JavaScript implementation of the [Avro specification](https://avro.apache.org/docs/current/spec.html) (compliant with the current version, 1.8.1).

However the current latest version of the Avro specification is 1.11.1

Does avsc still only implement Avro 1.8.1, or does it implement a later version that the docs need to be updated to reflect?

@mtth
Copy link
Owner

mtth commented Apr 28, 2024

Hi @fergalmonaghan. avsc implements 1.8.1 and a subset of newer features (see #238). I haven't kept up with specification updates but I'm open to adding functionality to catch up. To start, it would be helpful to know which new features are most useful.

@mtth mtth added the question label Apr 28, 2024
@francescopessina87
Copy link

Hi @mtth ! A very useful feature, introduced in Avro 1.9.1, would be the possibility to specify an enum default symbol, in order to ensure compatibility.

@francescopessina87
Copy link

Hi @mtth ! A very useful feature, introduced in Avro 1.9.1, would be the possibility to specify an enum default symbol, in order to ensure compatibility.

@mtth hi :) Any news on this? To be more precise, I am using avsc to generate an avro schemas composing different "smaller" schemas.

My problem is that, if I add to the avsc registry a schema an enum default symbol, then then generated schemas which uses the enum I added in the registry won't have it.

For example, if I add to the registry a schema like this:

  {
        "type": "enum",
        "name": "MyEnum",
        "symbols": [
          "a",
          "b",
          "Unknown"
        ],
        /* 
         * Symbol default - for forwards compatibility - 
         * new in Avro 1.9.0
         */
         "default": "Unknown"  
      }

And then I try to generate, using avsc and the registry, the schema for this avro:

{
  "type": "Record",
  "name: "Test",
  "fields": [
    {
      "name": "testEnum",
      "type": "MyEnum",
      "default": "Unknown"
    }
  ]
}

then the resulting schema is like this, without the default symbol:

{
  "type": "Record",
  "name: "Test",
  "fields": [
    {
      "name": "testEnum",
      "type": {
        {
          "type": "enum",
          "name": "MyEnum",
          "symbols": [
            "a",
            "b",
            "Unknown"
          ],
        // here I should expect `"default": "Unknown"`, but it is removed by avsc
        },
     "default": "Unknown"
      }
    }
  ]
}

Do you think you can implement this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants