[
https://issues.apache.org/jira/browse/FLINK-16969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jeff Zhang updated FLINK-16969:
-------------------------------
Description:
{code:java}
case class WC(word: String, count: Int)
val wordCounts = benv.fromElements(WC("hello", 1),WC("world", 2), WC("world",
8))
wordCounts.collect(){code}
Get the following exception
{code}
java.lang.IllegalArgumentException: requirement failed:
The class WC is an instance class, meaning it is not a member of a
toplevel object, or of an object contained in a toplevel object,
therefore it requires an outer instance to be instantiated, but we don't have a
reference to the outer instance. Please consider changing the outer class to an
object.
at scala.Predef$.require(Predef.scala:224)
at
org.apache.flink.api.scala.typeutils.ScalaCaseClassSerializer$.lookupConstructor(ScalaCaseClassSerializer.scala:90)
at
org.apache.flink.api.scala.typeutils.ScalaCaseClassSerializer.<init>(ScalaCaseClassSerializer.scala:46)
... 66 elided
{code}
was:
{code:java}
case class WC(word: String, count: Int)val wordCounts =
benv.fromElements(WC("hello", 1),WC("world", 2), WC("world", 8))
wordCounts.collect()
java.lang.IllegalArgumentException: requirement failed:The class WC is an
instance class, meaning it is not a member of atoplevel object, or of an object
contained in a toplevel object,therefore it requires an outer instance to be
instantiated, but we don't have areference to the outer instance. Please
consider changing the outer class to an object.
at scala.Predef$.require(Predef.scala:224) at
org.apache.flink.api.scala.typeutils.ScalaCaseClassSerializer$.lookupConstructor(ScalaCaseClassSerializer.scala:90)
at
org.apache.flink.api.scala.typeutils.ScalaCaseClassSerializer.<init>(ScalaCaseClassSerializer.scala:46)
... 66 elided{code}
> Unable to use case class in flink scala shell
> ---------------------------------------------
>
> Key: FLINK-16969
> URL: https://issues.apache.org/jira/browse/FLINK-16969
> Project: Flink
> Issue Type: Bug
> Components: Scala Shell
> Affects Versions: 1.10.0
> Reporter: Jeff Zhang
> Priority: Major
>
> {code:java}
> case class WC(word: String, count: Int)
> val wordCounts = benv.fromElements(WC("hello", 1),WC("world", 2), WC("world",
> 8))
> wordCounts.collect(){code}
> Get the following exception
> {code}
> java.lang.IllegalArgumentException: requirement failed:
> The class WC is an instance class, meaning it is not a member of a
> toplevel object, or of an object contained in a toplevel object,
> therefore it requires an outer instance to be instantiated, but we don't have
> a
> reference to the outer instance. Please consider changing the outer class to
> an object.
> at scala.Predef$.require(Predef.scala:224)
> at
> org.apache.flink.api.scala.typeutils.ScalaCaseClassSerializer$.lookupConstructor(ScalaCaseClassSerializer.scala:90)
> at
> org.apache.flink.api.scala.typeutils.ScalaCaseClassSerializer.<init>(ScalaCaseClassSerializer.scala:46)
> ... 66 elided
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)