fn sql_select_to_rex(
        &self,
        sql: &sqlparser::ast::SelectItem,
        schema: &DataSchema,
        select: Option<&sqlparser::ast::Select>,
    ) -> Result<Expression> {
        match sql {
            sqlparser::ast::SelectItem::UnnamedExpr(expr) => self.sql_to_rex(expr, schema, select),
            sqlparser::ast::SelectItem::ExprWithAlias { expr, alias } => Ok(Expression::Alias(
                alias.value.clone(),
                Box::new(self.sql_to_rex(expr, schema, select)?),
            )),
            sqlparser::ast::SelectItem::Wildcard => Ok(Expression::Wildcard),
            _ => Result::Err(ErrorCode::UnImplement(format!(
                "SelectItem: {:?} are not supported",
                sql
            ))),
        }
    }
/// Generate a relational expression from a select SQL expression
Generate a relational expression from a select SQL expression
Generate a relational expression from a select SQL expression
fn sql_select_to_rex(
        &self,
        sql: &sqlparser::ast::SelectItem,
        schema: &DataSchema,
        select: Option<&sqlparser::ast::Select>,
    ) -> Result<Expression> {
        match sql {
            sqlparser::ast::SelectItem::UnnamedExpr(expr) => self.sql_to_rex(expr, schema, select),
            sqlparser::ast::SelectItem::ExprWithAlias { expr, alias } => Ok(Expression::Alias(
                alias.value.clone(),
                Box::new(self.sql_to_rex(expr, schema, select)?),
            )),
            sqlparser::ast::SelectItem::Wildcard => Ok(Expression::Wildcard),
            _ => Result::Err(ErrorCode::UnImplement(format!(
                "SelectItem: {:?} are not supported",
                sql
            ))),
        }
    }
fn sql_select_to_rex ( & self , sql : & sqlparser :: ast :: SelectItem , schema : & DataSchema , select : Option < & sqlparser :: ast :: Select > , ) -> Result < Expression > { match sql { sqlparser :: ast :: SelectItem :: UnnamedExpr ( expr ) => self . sql_to_rex ( expr , schema , select ) , sqlparser :: ast :: SelectItem :: ExprWithAlias { expr , alias } => Ok ( Expression :: Alias ( alias . value . clone ( ) , Box :: new ( self . sql_to_rex ( expr , schema , select ) ? ) , ) ) , sqlparser :: ast :: SelectItem :: Wildcard => Ok ( Expression :: Wildcard ) , _ => Result :: Err ( ErrorCode :: UnImplement ( format ! ( " " sql ) ) ) , } }
Generate a relational expression from a select SQL expression
Generate a relational expression from a select SQL expression
&self
sql
&sqlparser::ast::SelectItem
schema
&DataSchema
select
Option<&sqlparser::ast::Select>
&self
sql
&sqlparser::ast::SelectItem
schema
&DataSchema
select
Option<&sqlparser::ast::Select>