vmware-archive / database-stream-processor

Streaming and Incremental Computation Framework
Other
225 stars 20 forks source link

[JIT] flat_map operator with Option output #339

Open mihaibudiu opened 1 year ago

mihaibudiu commented 1 year ago

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);
Kixiron commented 1 year ago

Yes, but for this specific case you should use FilterMap

mihaibudiu commented 1 year ago

Is there an example with FilterMap?