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

Schema in generated Java class is different than the original one

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • java
    • None

    Description

      If you generate Java classes from schema, SCHEMA$ variable differs from the original schema. It causes issues like this and this when using Schema registry.

      The issue happens when the schema in the registry is configured externally and then you try to use generated Java class. The schema in the registry does not match the schema in the class and thus the write is refused.

      Technically it's easy to fix (see the attached patch) but I guess there will be some backward compatibility concerns.

      If it is not acceptable, would it be at least possible to add the originalSchema context variable so we could solve it using custom template.

      The patch is not final, its purpose is just to convey the idea.

      Attachments

        1. AVRO.patch
          3 kB
          Lukas Krecan

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dart0 Lukas Krecan
              Votes:
              10 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated: