Yea, it goes through many events from this input before the exception is 
thrown. I don’t know how the input schema can change though, as the input is 
always producing objects from the same class.


From: JING ZHANG <beyond1...@gmail.com>
Sent: Thursday, August 12, 2021 10:22 PM
To: Nathan Yu <nuonathan...@twosigma.com>
Cc: user@flink.apache.org
Subject: Re: Bug with PojoSerializer? java.lang.IllegalArgumentException: Can 
not set final double field Event.rating to java.lang.Integer

Hi Yu,
The exception is thrown after processing some input data instead of at the 
beginning of the input, right?
Is there any possible that input schema has updated?

Nathan Yu <nuonathan...@twosigma.com<mailto:nuonathan...@twosigma.com>> 
于2021年8月13日周五 上午8:38写道:

•         Using local environment: 
StreamExecutionEnvironment.createLocalEnvironment()

•        Event is a POJO class, with int, double, enum, and String fields

•        Unfortunately it’s hard for me to reproduce in a small example, as it 
seems to occur after 10e6+ events.

•        Using flink-core-1.12.4

Stack:
Caused by: java.lang.IllegalArgumentException: Can not set final double field 
com.twosigma.research.options.optticks.core.types.Event.askPrice to 
java.lang.Integer
        at 
java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
        at 
java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
        at 
java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:58)
        at 
java.base/jdk.internal.reflect.UnsafeQualifiedDoubleFieldAccessorImpl.set(UnsafeQualifiedDoubleFieldAccessorImpl.java:77)
        at java.base/java.lang.reflect.Field.set(Field.java:780)
        at 
org.apache.flink.api.java.typeutils.runtime.PojoSerializer.initializeFields(PojoSerializer.java:205)
        at 
org.apache.flink.api.java.typeutils.runtime.PojoSerializer.deserialize(PojoSerializer.java:388)
        at 
org.apache.flink.api.java.typeutils.runtime.PojoSerializer.deserialize(PojoSerializer.java:409)
        at 
org.apache.flink.streaming.runtime.streamrecord.StreamElementSerializer.deserialize(StreamElementSerializer.java:191)
        at 
org.apache.flink.streaming.runtime.streamrecord.StreamElementSerializer.deserialize(StreamElementSerializer.java:46)
        at 
org.apache.flink.runtime.plugable.NonReusingDeserializationDelegate.read(NonReusingDeserializationDelegate.java:53)

Reply via email to