[
https://issues.apache.org/jira/browse/FLINK-3304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15134424#comment-15134424
]
Robert Metzger commented on FLINK-3304:
---------------------------------------
The problem is that the Schema is not serializable.
The issue can be fixed by making the field
{{private Schema userDefinedSchema = null;}}
transient
and implementing custom java serialization methods. There I would serialize the
schema to JSON (Schema.toString()) and parse it on deserialize again
(Schema.parse(String)).
Would you like to fix this yourself or should I do it?
> AvroOutputFormat.setSchema() doesn't work in yarn-cluster mode
> --------------------------------------------------------------
>
> Key: FLINK-3304
> URL: https://issues.apache.org/jira/browse/FLINK-3304
> Project: Flink
> Issue Type: Bug
> Affects Versions: 1.0.0, 0.10.1
> Reporter: Sebastian Klemke
>
> Quoting flink cli (schema and names modified):
> "The program finished with the following exception:
> User-defined object org.apache.flink.api.java.io.AvroOutputFormat@5f253dfb
> (org.apache.flink.api.java.io.AvroOutputFormat) contains non-serializable
> field userDefinedSchema =
> {"type":"record","name":"Pojo","namespace":"com.example","fields":[{"name":"id","type":["null","string"],"default":null,"subtype":"objectid"}],"EntityVersion":"0.1.0"}
>
> org.apache.flink.api.common.operators.util.UserCodeObjectWrapper.<init>(UserCodeObjectWrapper.java:84)
>
> org.apache.flink.api.common.operators.GenericDataSinkBase.<init>(GenericDataSinkBase.java:68)
>
> org.apache.flink.api.java.operators.DataSink.translateToDataFlow(DataSink.java:258)
>
> org.apache.flink.api.java.operators.OperatorTranslation.translate(OperatorTranslation.java:64)
>
> org.apache.flink.api.java.operators.OperatorTranslation.translateToPlan(OperatorTranslation.java:49)
>
> org.apache.flink.api.java.ExecutionEnvironment.createProgramPlan(ExecutionEnvironment.java:939)
>
> org.apache.flink.api.java.ExecutionEnvironment.createProgramPlan(ExecutionEnvironment.java:907)
>
> org.apache.flink.client.program.ContextEnvironment.execute(ContextEnvironment.java:57)
> com.example.Tool.main(Tool.java:86)
> Shutting down YARN cluster"
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)