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

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: java
    • Labels:
      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

              • Assignee:
                Unassigned
                Reporter:
                dart0 Lukas Krecan
              • Votes:
                10 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated: