That's sounds like a classloading or most likely dependency issue.
Are all dependencies including Flink use the same Scala version? Could
you maybe share reproducible some code with us?
Regards,
Timo
On 19.12.19 13:53, Alexandru Vasiu wrote:
I'm sorry for my last message, it might be incomplete.
So I used case classed for my objects, but it doesn't work.
Riching this error: "Exception in thread "main"
org.apache.flink.shaded.guava18.com.google.common.util.concurrent.ExecutionError:
java.lang.NoClassDefFoundError: scala/math/Ordering$$anon$9" when I'm
trying to apply the map/flatMap function over the stream (which is from
a Kafka consumer).
Alex
On Thu, Dec 19, 2019 at 2:24 PM Alexandru Vasiu
<alexandru.ava...@gmail.com <mailto:alexandru.ava...@gmail.com>> wrote:
I used `case class` for example case class A(a: Map[String, String])
so it should work
Alex
On Thu, Dec 19, 2019 at 2:18 PM Timo Walther <twal...@apache.org
<mailto:twal...@apache.org>> wrote:
Hi Alex,
the problem is that `case class` classes are analyzed by Scala
specific
code whereas `class` classes are analyzed with Java specific
code. So I
would recommend to use a case class to make sure you stay in the
"Scala
world" otherwise the fallback is the Java-based TypeExtractor.
For your custom Map, you can simply ignore this error message.
It will
fallback to the Java-based TypeExtractor and treat it as a
generic type
because it is not a POJO.
I hope this helps.
Regards,
Timo
On 19.12.19 12:41, Alexandru Vasiu wrote:
> Hi,
>
> I use flink-scala version 1.9.1 and scala 2.12.10, and I
defined a data
> type which is a bit more complex: it has a list in it and even a
> dictionary. When I try to use a custom map I got this error:
>
> INFO org.apache.flink.api.java.typeutils.TypeExtractor -
class A does
> not contain a setter for field fields
> INFO org.apache.flink.api.java.typeutils.TypeExtractor -
class A cannot
> be used as a POJO type because not all fields are valid POJO
fields, and
> must be processed as GenericType. Please read the Flink
documentation on
> "Data Types & Serialization" for details of the effect on
performance.
>
> Is there a fix for this? Or a workaround?
>
> Thank you,
> Alex