You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by GitBox <gi...@apache.org> on 2022/12/15 07:25:08 UTC

[GitHub] [avro] horizonzy opened a new pull request, #2013: Fix NPE when basic type with Nullable annotation.

horizonzy opened a new pull request, #2013:
URL: https://github.com/apache/avro/pull/2013

   ```
       @Data
       @AllArgsConstructor
       @NoArgsConstructor
       public static class Person {
           String name;
           int age;
           String address;
           double score;
       }
   
       @Data
       @AllArgsConstructor
       @NoArgsConstructor
       public static class PersonV2 {
           String name;
           int age;
           String address;
           double score;
   
           @Nullable
           String country;
           @Nullable
           int phone;
           @Nullable
           double salary;
       }
   ```
   
   Use personV2 schema to read personV1 data; it will throw NPE.
   
   
   When the basic type value is null, use the default value to populate it.
   


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] horizonzy commented on pull request #2013: Fix NPE when basic type with Nullable annotation.

Posted by "horizonzy (via GitHub)" <gi...@apache.org>.
horizonzy commented on PR #2013:
URL: https://github.com/apache/avro/pull/2013#issuecomment-1434662859

   @nielsbasjes ping


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] nielsbasjes commented on pull request #2013: Fix NPE when basic type with Nullable annotation.

Posted by "nielsbasjes (via GitHub)" <gi...@apache.org>.
nielsbasjes commented on PR #2013:
URL: https://github.com/apache/avro/pull/2013#issuecomment-1434869139

   I did a quick scan of the code and it looks like it is automatically using the `FieldAccessUnsafe` if that is possible ( https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/reflect/ReflectionUtil.java#L60 and https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/reflect/FieldAccessUnsafe.java#L38 )
   So my guess is that in Java 19 `theUnsafe` is no longer possible and you get the `FieldAccessReflect` instead.
   
   At this point I do not know how to fix this.
   @martin-g / @clesaec Any ideas?
   
   
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] horizonzy commented on pull request #2013: Fix NPE when basic type with Nullable annotation.

Posted by GitBox <gi...@apache.org>.
horizonzy commented on PR #2013:
URL: https://github.com/apache/avro/pull/2013#issuecomment-1367113249

   > LGTM, advice to commiter for merging ?
   
   Thanks.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] clesaec commented on pull request #2013: Fix NPE when basic type with Nullable annotation.

Posted by GitBox <gi...@apache.org>.
clesaec commented on PR #2013:
URL: https://github.com/apache/avro/pull/2013#issuecomment-1353313310

   Just run command `mvn spotless::apply` to remove spotless alert (on lang/java folder)
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] nielsbasjes commented on pull request #2013: Fix NPE when basic type with Nullable annotation.

Posted by "nielsbasjes (via GitHub)" <gi...@apache.org>.
nielsbasjes commented on PR #2013:
URL: https://github.com/apache/avro/pull/2013#issuecomment-1434481033

   @horizonzy Fix looks great. Can you please add a test somewhere that shows this to be fixed?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] horizonzy closed pull request #2013: Fix NPE when basic type with Nullable annotation.

Posted by "horizonzy (via GitHub)" <gi...@apache.org>.
horizonzy closed pull request #2013: Fix NPE when basic type with Nullable annotation.
URL: https://github.com/apache/avro/pull/2013


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] horizonzy commented on pull request #2013: Fix NPE when basic type with Nullable annotation.

Posted by "horizonzy (via GitHub)" <gi...@apache.org>.
horizonzy commented on PR #2013:
URL: https://github.com/apache/avro/pull/2013#issuecomment-1434696286

   Test test java19 failed, it looks like the java19 use `FieldAccessReflect` instead of `FieldAccessUnsafe`, how to fix it? Any ideas? @nielsbasjes 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] horizonzy commented on pull request #2013: Fix NPE when basic type with Nullable annotation.

Posted by "horizonzy (via GitHub)" <gi...@apache.org>.
horizonzy commented on PR #2013:
URL: https://github.com/apache/avro/pull/2013#issuecomment-1435701496

   > LGTM Is there a jira issue for this fix? If not I'll create one.
   
   Please help to do it. Thanks.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] nielsbasjes merged pull request #2013: Fix NPE when basic type with Nullable annotation.

Posted by "nielsbasjes (via GitHub)" <gi...@apache.org>.
nielsbasjes merged PR #2013:
URL: https://github.com/apache/avro/pull/2013


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] horizonzy commented on pull request #2013: Fix NPE when basic type with Nullable annotation.

Posted by "horizonzy (via GitHub)" <gi...@apache.org>.
horizonzy commented on PR #2013:
URL: https://github.com/apache/avro/pull/2013#issuecomment-1435523703

   @nielsbasjes Fixed, make FieldAccessReflect also support basic type.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org