Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in processUnion #15

Open
oobles opened this issue Nov 18, 2019 · 1 comment
Open

NPE in processUnion #15

oobles opened this issue Nov 18, 2019 · 1 comment

Comments

@oobles
Copy link

oobles commented Nov 18, 2019

We're seeing the following NPE when running on Java 11 using fastserde-1.0.5.

com.rtbhouse.utils.avro.FastDeserializerGeneratorException: java.lang.NullPointerException
at com.rtbhouse.utils.avro.FastDeserializerGenerator.generateDeserializer(FastDeserializerGenerator.java:139) ~[avro-fastserde-1.0.5.jar:?]
at com.rtbhouse.utils.avro.FastSerdeCache.buildSpecificDeserializer(FastSerdeCache.java:319) ~[avro-fastserde-1.0.5.jar:?]
at com.rtbhouse.utils.avro.FastSerdeCache.lambda$getFastSpecificDeserializer$1(FastSerdeCache.java:207) ~[avro-fastserde-1.0.5.jar:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.NullPointerException
at com.rtbhouse.utils.avro.FastDeserializerGenerator.processUnion(FastDeserializerGenerator.java:473) ~[avro-fastserde-1.0.5.jar:?]
at com.rtbhouse.utils.avro.FastDeserializerGenerator.processComplexType(FastDeserializerGenerator.java:157) ~[avro-fastserde-1.0.5.jar:?]
at com.rtbhouse.utils.avro.FastDeserializerGenerator.processRecord(FastDeserializerGenerator.java:264) ~[avro-fastserde-1.0.5.jar:?]
at com.rtbhouse.utils.avro.FastDeserializerGenerator.generateDeserializer(FastDeserializerGenerator.java:102) ~[avro-fastserde-1.0.5.jar:?]
... 6 more

The error is at this line:

Symbol.UnionAdjustAction unionAdjustAction = (Symbol.UnionAdjustAction) alternative.symbols[i].production[0];

The production == null.

I think the relevant part of the schema is the "type" in the following:

{
"name": "name",
"type": ["null", "string"]
}

@flowenol
Copy link
Contributor

Thank you for posting this issue, however it would be helpful if you could provide some more information regarding the version of avro library you are using (especially, if it is above 1.8.2) and the minimal schema which reproduces the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants