database-stream-processor icon indicating copy to clipboard operation
database-stream-processor copied to clipboard

[JIT] flat_map operator with Option output

Open mihaibudiu opened this issue 2 years ago • 2 comments

Does the JIT compiler support this use of the flat_map operator?

        let filter0: _ = move |r: &Tuple6<i32, F64, bool, String, Option<i32>, Option<F64>>, | -> Option<Tuple6<i32, F64, bool, String, Option<i32>, Option<F64>>> {
            (if r.4.is_none() {
                None::<Tuple6<i32, F64, bool, String, Option<i32>, Option<F64>>>
            } else {
                Some(r.clone())
            })
        };
        let stream0: Stream<_, OrdZSet<Tuple6<i32, F64, bool, String, Option<i32>, Option<F64>>, Weight>> = T.flat_map(filter0);

mihaibudiu avatar Mar 17 '23 20:03 mihaibudiu

Yes, but for this specific case you should use FilterMap

Kixiron avatar Mar 17 '23 20:03 Kixiron

Is there an example with FilterMap?

mihaibudiu avatar Mar 17 '23 20:03 mihaibudiu