|
15 | 15 |
|
16 | 16 | use std::collections::HashMap; |
17 | 17 |
|
18 | | -use datafusion::common::{plan_err, Result}; |
| 18 | +use datafusion::common::{Result, plan_err}; |
19 | 19 | use datafusion::error::DataFusionError; |
20 | 20 | use datafusion::sql::sqlparser::ast::{ |
21 | 21 | ObjectType, ShowCreateObject, SqlOption, Statement as DFStatement, |
@@ -50,9 +50,9 @@ pub fn classify_statement(stmt: DFStatement) -> Result<Box<dyn Statement>> { |
50 | 50 | DFStatement::ShowStreamingTable => Ok(Box::new(ShowStreamingTables::new())), |
51 | 51 | DFStatement::ShowCreate { obj_type, obj_name } => match obj_type { |
52 | 52 | ShowCreateObject::Table => Ok(Box::new(ShowCreateTable::new(obj_name.to_string()))), |
53 | | - ShowCreateObject::StreamingTable => { |
54 | | - Ok(Box::new(ShowCreateStreamingTable::new(obj_name.to_string()))) |
55 | | - } |
| 53 | + ShowCreateObject::StreamingTable => Ok(Box::new(ShowCreateStreamingTable::new( |
| 54 | + obj_name.to_string(), |
| 55 | + ))), |
56 | 56 | _ => plan_err!( |
57 | 57 | "SHOW CREATE {obj_type} is not supported; use SHOW CREATE TABLE or SHOW CREATE STREAMING TABLE <name>" |
58 | 58 | ), |
@@ -88,11 +88,12 @@ pub fn classify_statement(stmt: DFStatement) -> Result<Box<dyn Statement>> { |
88 | 88 | } |
89 | 89 | let table_name = names[0].to_string(); |
90 | 90 | Ok(Box::new(DropStreamingTableStatement::new( |
91 | | - table_name, |
92 | | - *if_exists, |
| 91 | + table_name, *if_exists, |
93 | 92 | ))) |
94 | 93 | } |
95 | | - _ => plan_err!("Only DROP TABLE and DROP STREAMING TABLE are supported in this SQL frontend"), |
| 94 | + _ => plan_err!( |
| 95 | + "Only DROP TABLE and DROP STREAMING TABLE are supported in this SQL frontend" |
| 96 | + ), |
96 | 97 | } |
97 | 98 | } |
98 | 99 | DFStatement::Insert { .. } => plan_err!( |
|
0 commit comments