Hi, I'm trying to figure out how to serialize Scal...
# troubleshooting
k
Hi, I'm trying to figure out how to serialize Scala case classes without Kryo, but haven't had any luck. When I turn off generic types I get this error:
org.apache.flink.client.program.ProgramInvocationException: The main method caused an error: Generic types have been disabled in the ExecutionConfig and type KeyedOutputEvent2 is treated as a generic type.
Seems like this should be possible based on the documentation.
s
Hey, do you have this import?
Copy code
import org.apache.flink.streaming.api.scala._
k
I don't. What does that do?
s
Everything! 🙂 When you’re using the Scala API it brings a lot of useful implicits in the scope, some of them are needed for serialization.
k
Where does this need to be imported? In the class setting up the stream, in the MapFunction classes, etc?
s
In the class setting up the stream
^, whatever defines the topology, where you call you operators
k
It's still treating it as a generic type after the import. case class is very simple:
Copy code
case class KeyedOutputEvent3(
  key: String,
  maid: String,
  os: Int,
  app: Long,
  ts: Long,
  flags: Int,
  lat: Double,
  lon: Double,
  ha: Double,
  vel: Double,
  iso3: String,
  ip: String,
  conn_type: String,
  carrier: String,
  make: String,
  model: String,
  ua: String,
  us_privacy: String)