Flink之基本转换算子(map/flatMap/filter)

map

顾名思义,就是转换,将流中进去的每一个元素转成另外一种元素。
在这里插入图片描述
我们需要实现接口MapFunction

// T: the type of input elements
// O: the type of output elements
MapFunction[T, O]
map(T): O

比如:

val sensorIds: DataStream[String] = readings.map(new MyMapFunction)

猜你喜欢

转载自blog.csdn.net/MissWYAN/article/details/108947694