risingwave_stream/from_proto/
hop_window.rs1use risingwave_expr::expr::build_non_strict_from_prost;
16use risingwave_pb::stream_plan::HopWindowNode;
17
18use super::*;
19use crate::executor::HopWindowExecutor;
20
21pub struct HopWindowExecutorBuilder;
22
23impl ExecutorBuilder for HopWindowExecutorBuilder {
24 type Node = HopWindowNode;
25
26 async fn new_boxed_executor(
27 params: ExecutorParams,
28 node: &Self::Node,
29 _store: impl StateStore,
30 ) -> StreamResult<Executor> {
31 let input = params.input.into_iter().next().unwrap();
32 let output_indices = node
34 .get_output_indices()
35 .iter()
36 .map(|&x| x as usize)
37 .collect_vec();
38
39 let window_start_exprs: Vec<_> = node
40 .get_window_start_exprs()
41 .iter()
42 .map(|e| build_non_strict_from_prost(e, params.eval_error_report.clone()))
43 .try_collect()?;
44 let window_end_exprs: Vec<_> = node
45 .get_window_end_exprs()
46 .iter()
47 .map(|e| build_non_strict_from_prost(e, params.eval_error_report.clone()))
48 .try_collect()?;
49
50 let time_col = node.get_time_col() as usize;
51 let window_slide = node.get_window_slide()?.into();
52 let window_size = node.get_window_size()?.into();
53
54 let chunk_size = params.env.config().developer.chunk_size;
55
56 let exec = HopWindowExecutor::new(
57 params.actor_context,
58 input,
59 time_col,
60 window_slide,
61 window_size,
62 window_start_exprs,
63 window_end_exprs,
64 output_indices,
65 chunk_size,
66 );
67 Ok((params.info, exec).into())
68 }
69}