mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-22 06:54:07 +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
|
@ -1376,6 +1376,36 @@ fn parse_select_table_function_settings() {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn explain_describe() {
|
||||
clickhouse().verified_stmt("DESCRIBE test.table");
|
||||
clickhouse().verified_stmt("DESCRIBE TABLE test.table");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn explain_desc() {
|
||||
clickhouse().verified_stmt("DESC test.table");
|
||||
clickhouse().verified_stmt("DESC TABLE test.table");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_explain_table() {
|
||||
match clickhouse().verified_stmt("EXPLAIN TABLE test_identifier") {
|
||||
Statement::ExplainTable {
|
||||
describe_alias,
|
||||
hive_format,
|
||||
has_table_keyword,
|
||||
table_name,
|
||||
} => {
|
||||
pretty_assertions::assert_eq!(describe_alias, DescribeAlias::Explain);
|
||||
pretty_assertions::assert_eq!(hive_format, None);
|
||||
pretty_assertions::assert_eq!(has_table_keyword, true);
|
||||
pretty_assertions::assert_eq!("test_identifier", table_name.to_string());
|
||||
}
|
||||
_ => panic!("Unexpected Statement, must be ExplainTable"),
|
||||
}
|
||||
}
|
||||
|
||||
fn clickhouse() -> TestedDialects {
|
||||
TestedDialects {
|
||||
dialects: vec![Box::new(ClickHouseDialect {})],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue