fix: only require DESCRIBE TABLE for Snowflake and ClickHouse dialect (#1386)

This commit is contained in:
Andrew Lamb 2024-08-16 05:54:58 -04:00 committed by GitHub
parent 8c4d30bb6d
commit dd78084ca0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 103 additions and 32 deletions

View file

@ -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 {})],