From dev-return-30349-archive-asf-public=cust-asf.ponee.io@avro.apache.org Thu Mar 11 10:02:09 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 1F31E18062C for ; Thu, 11 Mar 2021 11:02:09 +0100 (CET) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 61EE764FCA for ; Thu, 11 Mar 2021 10:02:02 +0000 (UTC) Received: (qmail 70617 invoked by uid 500); 11 Mar 2021 10:02:01 -0000 Mailing-List: contact dev-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@avro.apache.org Delivered-To: mailing list dev@avro.apache.org Received: (qmail 70540 invoked by uid 99); 11 Mar 2021 10:02:01 -0000 Received: from mailrelay1-he-de.apache.org (HELO mailrelay1-he-de.apache.org) (116.203.21.61) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Mar 2021 10:02:01 +0000 Received: from jira2-he-de.apache.org (unknown [IPv6:2a01:4f8:242:1f49::2]) by mailrelay1-he-de.apache.org (ASF Mail Server at mailrelay1-he-de.apache.org) with ESMTPS id 3B32B3E847 for ; Thu, 11 Mar 2021 10:02:00 +0000 (UTC) Received: from jira2-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira2-he-de.apache.org (ASF Mail Server at jira2-he-de.apache.org) with ESMTP id 2324EC802F3 for ; Thu, 11 Mar 2021 10:02:00 +0000 (UTC) Date: Thu, 11 Mar 2021 10:02:00 +0000 (UTC) From: "Emilio Jose Mena Cebrian (Jira)" To: dev@avro.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AVRO-2838) Schema in generated Java class is different than the original one MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AVRO-2838?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D17299= 458#comment-17299458 ]=20 Emilio Jose Mena Cebrian commented on AVRO-2838: ------------------------------------------------ +1 If you are mixing technologies (producer in java consumer in other langu= age or vice versa), It could lead to unexpected behaviors. Modifiying a schema is not good for contract-first approach. =C2=A0 =C2=A0 =C2=A0 > Schema in generated Java class is different than the original one > ----------------------------------------------------------------- > > Key: AVRO-2838 > URL: https://issues.apache.org/jira/browse/AVRO-2838 > Project: Apache Avro > Issue Type: Bug > Components: java > Reporter: Lukas Krecan > Priority: Major > Attachments: AVRO.patch > > > If you generate Java classes from schema, {{SCHEMA$}} variable differs fr= om the original schema. It causes issues like [this|https://github.com/conf= luentinc/schema-registry/issues/868] and [this|https://github.com/confluent= inc/schema-registry/issues/1352] when using Schema registry. > The issue happens when the schema in the registry is configured externall= y 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 w= ill be some backward compatibility concerns.=20 > If it is not acceptable, would it be at least possible to add the {{origi= nalSchema}} context variable so we could solve it using custom template. > The patch is not final, its purpose is just to convey the idea. -- This message was sent by Atlassian Jira (v8.3.4#803005)