1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::planner::LogicalPlan;

use super::Operator;

#[derive(Debug, PartialEq, Eq, Clone, Hash)]
pub struct LimitOperator {
    pub offset: Option<usize>,
    pub limit: Option<usize>,
}

impl LimitOperator {
    pub fn build(
        offset: Option<usize>,
        limit: Option<usize>,
        children: LogicalPlan,
    ) -> LogicalPlan {
        LogicalPlan {
            operator: Operator::Limit(LimitOperator { offset, limit }),
            childrens: vec![children],
        }
    }
}