TypeSerializerInputFormat cannot determine its type automatically

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

TypeSerializerInputFormat cannot determine its type automatically

Alexander Alexandrov
I am trying to use the TypeSerializer IO formats to write temp data to disk. A gist with a minimal example can be found here:

https://gist.github.com/aalexandrov/90bf21f66bf604676f37

However, with the current setting I get the following error with the TypeSerializerInputFormat:

Exception in thread "main" org.apache.flink.api.common.InvalidProgramException: The type returned by the input format could not be automatically determined. Please specify the TypeInformation of the produced type explicitly.
    at org.apache.flink.api.java.ExecutionEnvironment.readFile(ExecutionEnvironment.java:341)
    at SerializedFormatExample$.main(SerializedFormatExample.scala:48)
    at SerializedFormatExample.main(SerializedFormatExample.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

I think that the typeInformation instance at line 43 should be somehow passed to the TypeSerializerInputFormat, but I cannot find a way to do it.

Any suggestions?

Thanks,
A.