Example #1
0
        /// <summary>
        /// Applies a FlatMap transformation on a <see cref="DataStream{T}"/>. The transformation calls a <see cref="IFlatMapFunction{TInput,TOutput}"/> for each element of the DataStream. Each FlatMapFunction call can return any number of elements including none. The user can also extend <see cref="IRichFunction"/> to gain access to other features provided by the  <see cref="IRichFunction"/> interface.
        /// </summary>
        /// <typeparam name="TOutput">The output type.</typeparam>
        /// <param name="flatMapper">The MapFunction that is called for each element of the DataStream.</param>
        /// <returns>The transformed <see cref="DataStream{T}"/>.</returns>
        public SingleOutputStreamOperator <TOutput> FlatMap <TOutput>(IFlatMapFunction <TElement, TOutput> flatMapper)
        {
            var outType = TypeExtractor.GetFlatMapReturnTypes(Clean(flatMapper), Type, Utils.GetCallLocationName(), true);

            return(Transform("Flat Map", outType, new StreamFlatMap <TElement, TOutput>(Clean(flatMapper))));
        }