mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-07 17:04:59 +00:00
fix: only require DESCRIBE TABLE
for Snowflake and ClickHouse dialect (#1386)
This commit is contained in:
parent
8c4d30bb6d
commit
dd78084ca0
8 changed files with 103 additions and 32 deletions
|
@ -21,7 +21,7 @@ use sqlparser::ast::{
|
|||
UnaryOperator, Value,
|
||||
};
|
||||
use sqlparser::dialect::{GenericDialect, HiveDialect, MsSqlDialect};
|
||||
use sqlparser::parser::{ParserError, ParserOptions};
|
||||
use sqlparser::parser::ParserError;
|
||||
use sqlparser::test_utils::*;
|
||||
|
||||
#[test]
|
||||
|
@ -35,18 +35,11 @@ fn parse_table_create() {
|
|||
hive().verified_stmt(serdeproperties);
|
||||
}
|
||||
|
||||
fn generic(options: Option<ParserOptions>) -> TestedDialects {
|
||||
TestedDialects {
|
||||
dialects: vec![Box::new(GenericDialect {})],
|
||||
options,
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_describe() {
|
||||
let describe = r#"DESCRIBE namespace.`table`"#;
|
||||
hive().verified_stmt(describe);
|
||||
generic(None).verified_stmt(describe);
|
||||
hive_and_generic().verified_stmt(r#"DESCRIBE namespace.`table`"#);
|
||||
hive_and_generic().verified_stmt(r#"DESCRIBE namespace.table"#);
|
||||
hive_and_generic().verified_stmt(r#"DESCRIBE table"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -414,3 +407,10 @@ fn hive() -> TestedDialects {
|
|||
options: None,
|
||||
}
|
||||
}
|
||||
|
||||
fn hive_and_generic() -> TestedDialects {
|
||||
TestedDialects {
|
||||
dialects: vec![Box::new(HiveDialect {}), Box::new(GenericDialect {})],
|
||||
options: None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue