Why OnDataStream in flink accepts partial function but DataStream do not

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Why OnDataStream in flink accepts partial function but DataStream do not

Renkai
As shown in
https://ci.apache.org/projects/flink/flink-docs-master/dev/scala_api_extensions.html
,we can use scala partitial function by

import org.apache.flink.streaming.api.scala.extensions._

and replace .map by .mapWith. but the signature of def mapWith[R:
TypeInformation](fun: T => R): DataStream[R] and def map[R:
TypeInformation](fun: T => R): DataStream[R] are exactly the same. So how
the different behavior happens?




--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Why OnDataStream in flink accepts partial function but DataStream do not

Dawid Wysakowicz-2
Hi,

AFAIK it clashes with

def map[R: TypeInformation](mapper: MapFunction[T, R]): DataStream[R]

if you use partially applied function. You can check the discussion
behind the OnDataStream implementation in this jira[1].

[1] https://issues.apache.org/jira/browse/FLINK-1159

On 31/01/2019 04:10, Renkai wrote:

> As shown in
> https://ci.apache.org/projects/flink/flink-docs-master/dev/scala_api_extensions.html
> ,we can use scala partitial function by
>
> import org.apache.flink.streaming.api.scala.extensions._
>
> and replace .map by .mapWith. but the signature of def mapWith[R:
> TypeInformation](fun: T => R): DataStream[R] and def map[R:
> TypeInformation](fun: T => R): DataStream[R] are exactly the same. So how
> the different behavior happens?
>
>
>
>
> --
> Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/


signature.asc (849 bytes) Download Attachment