/// Generate a logical plan from an SQL statement
Generate a logical plan from an SQL statement
Generate a logical plan from an SQL statement
pub fn sql_statement_to_plan(&self, sql: &Statement) -> Result<LogicalPlan> {
        match sql {
            Statement::Explain {
                verbose,
                statement,
                analyze: _,
            } => self.explain_statement_to_plan(*verbose, &statement),
            Statement::Query(query) => self.query_to_plan(&query),
            Statement::ShowVariable { variable } => self.show_variable_to_plan(&variable),
            Statement::ShowColumns {
                extended,
                full,
                table_name,
                filter,
            } => self.show_columns_to_plan(*extended, *full, table_name, filter.as_ref()),
            _ => Err(DataFusionError::NotImplemented(
                "Only SELECT statements are implemented".to_string(),
            )),
        }
    }
pub fn sql_statement_to_plan ( & self , sql : & Statement ) -> Result < LogicalPlan > { match sql { Statement :: Explain { verbose , statement , analyze : _ , } => self . explain_statement_to_plan ( * verbose , & statement ) , Statement :: Query ( query ) => self . query_to_plan ( & query ) , Statement :: ShowVariable { variable } => self . show_variable_to_plan ( & variable ) , Statement :: ShowColumns { extended , full , table_name , filter , } => self . show_columns_to_plan ( * extended , * full , table_name , filter . as_ref ( ) ) , _ => Err ( DataFusionError :: NotImplemented ( " " . to_string ( ) , ) ) , } }
Generate a logical plan from an SQL statement
Generate a logical plan from an SQL statement
&self
sql
&Statement