fn limit(&self, input: &PlanNode, limit: &Option<sqlparser::ast::Expr>) -> Result<PlanNode> {
        match *limit {
            Some(ref limit_expr) => {
                let n = match self.sql_to_rex(&limit_expr, &input.schema())? {
                    ExpressionPlan::Literal(DataValue::UInt64(Some(n))) => Ok(n as usize),
                    _ => Err(anyhow!("Unexpected expression for LIMIT clause")),
                }?;
                Ok(PlanBuilder::from(&input).limit(n)?.build()?)
            }
            _ => Ok(input.clone()),
        }
    }
/// Wrap a plan in a limit
Wrap a plan in a limit
Wrap a plan in a limit
fn limit(&self, input: &PlanNode, limit: &Option<sqlparser::ast::Expr>) -> Result<PlanNode> {
        match *limit {
            Some(ref limit_expr) => {
                let n = match self.sql_to_rex(&limit_expr, &input.schema())? {
                    ExpressionPlan::Literal(DataValue::UInt64(Some(n))) => Ok(n as usize),
                    _ => Err(anyhow!("Unexpected expression for LIMIT clause")),
                }?;
                Ok(PlanBuilder::from(&input).limit(n)?.build()?)
            }
            _ => Ok(input.clone()),
        }
    }
fn limit ( & self , input : & PlanNode , limit : & Option < sqlparser :: ast :: Expr > ) -> Result < PlanNode > { match * limit { Some ( ref limit_expr ) => { let n = match self . sql_to_rex ( & limit_expr , & input . schema ( ) ) ? { ExpressionPlan :: Literal ( DataValue :: UInt64 ( Some ( n ) ) ) => Ok ( n as usize ) , _ => Err ( anyhow ! ( " " ) ) , } ? ; Ok ( PlanBuilder :: from ( & input ) . limit ( n ) ? . build ( ) ? ) } _ => Ok ( input . clone ( ) ) , } }
Wrap a plan in a limit
Wrap a plan in a limit
&self
input
&PlanNode
limit
&Option<sqlparser::ast::Expr>
&self
input
&PlanNode
limit
&Option<sqlparser::ast::Expr>