From commits-return-23800-archive-asf-public=cust-asf.ponee.io@pulsar.apache.org Tue Mar 5 07:17:43 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 42A51180648 for ; Tue, 5 Mar 2019 08:17:43 +0100 (CET) Received: (qmail 11294 invoked by uid 500); 5 Mar 2019 07:17:42 -0000 Mailing-List: contact commits-help@pulsar.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pulsar.apache.org Delivered-To: mailing list commits@pulsar.apache.org Received: (qmail 11276 invoked by uid 99); 5 Mar 2019 07:17:42 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Mar 2019 07:17:42 +0000 From: GitBox To: commits@pulsar.apache.org Subject: [GitHub] [pulsar] jerrypeng edited a comment on issue #3741: POJO AvroSchema always allowNull Message-ID: <155177026186.613.13413544837688642473.gitbox@gitbox.apache.org> Date: Tue, 05 Mar 2019 07:17:41 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit jerrypeng edited a comment on issue #3741: POJO AvroSchema always allowNull URL: https://github.com/apache/pulsar/issues/3741#issuecomment-469565479 @sijie yup though I am not sure setting AllowNull is producing an incompatible schema. Incompatible to what? I guess if a user wrote some code: ``` ReflectData.get().getSchema(MyClass.class) ``` and they didn't set allow null then it wouldn't be compatible with the current schema generated from AvroSchema but my implementation could just have easily set allow null. Thus, this doesn't seem like big deal and arbitrary. However in Java, classes can be null and primitives cannot be. Should we not preserve that semantic? Is ```Integer``` the same as ```int```? e.g. should the following class: ``` public static class Foo { int field1; } ``` generate the same AVRO schema as ``` public static class Foo { Integer field1; ``` ? I am fine with removing AllowNull by default if everyone wants to do it but I think the bigger problem here is the one with shading and how generated java classes are handled since that is a API/standard that should work across systems. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services