[ 
https://issues.apache.org/jira/browse/FLINK-21386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17292152#comment-17292152
 ] 

Kezhu Wang commented on FLINK-21386:
------------------------------------

I think implementing {{OutputTypeConfigurable}} for {{FromElementsFunction}} 
could solve this. {{AbstractUdfStreamOperator}} will redirect 
{{OutputTypeConfigurable}} to user defined function. Here is my proposed steps:
 # Store a {{transient}} {{elements}} field for original elements.
 # Keep eagerly serialization but re-serialize if serializer from 
{{setOutputType}} differs from existing one.
 # Add new constructors with no {{serializer}} to postpone serialization to 
{{setOutputType}}.

[~chesnay] [~dwysakowicz] [~trohrmann] What do you think ?

> FromElements ignores returns()
> ------------------------------
>
>                 Key: FLINK-21386
>                 URL: https://issues.apache.org/jira/browse/FLINK-21386
>             Project: Flink
>          Issue Type: Bug
>          Components: API / DataStream
>    Affects Versions: 1.13.0
>            Reporter: Chesnay Schepler
>            Priority: Critical
>              Labels: usability
>             Fix For: 1.13.0
>
>
> StreamExEnv#fromElements eagerly serializes data with the automatically 
> determined serializer. This can result in errors for example when generic 
> avro records are used, because it will default to Kryo.
> Subsequent calls to returns() have no effect because the typeinformation is 
> never forwarded to the function.
> Annoyingly the fact that it serializes data isn't logged anywhere. and there 
> doesn't seem to be a way to change the serializer except by using 
> fromCollection() instead.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to