Apache Spark之DStream算子(章节五)
DStreams 转换算子 与RDD类似,转换允许修改来自输入DStream的数据。 DStreams支持普通Spark RDD上可用的许多转换。一些常见的如下。 Transformation Meaning map ( func ) Return a new DStream by passing each element of the source DStream through a function func . flatMap ( func ) Similar to map, but each input item can be mapped to 0 or more output items. filter ( func ) Return a new DStream by selecting only the records of the source DStream on which func returns true. repartition ( numPartitions ) Changes the level of parallelism in this DStream by creating more or fewer partitions. union ( otherStream ) Return a new DStream that contains the