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

@ -2292,3 +2292,33 @@ fn test_parse_position() {
snowflake().verified_query("SELECT position('an', 'banana', 1)");
snowflake().verified_query("SELECT n, h, POSITION(n IN h) FROM pos");
}
#[test]
fn explain_describe() {
snowflake().verified_stmt("DESCRIBE test.table");
snowflake().verified_stmt("DESCRIBE TABLE test.table");
}
#[test]
fn explain_desc() {
snowflake().verified_stmt("DESC test.table");
snowflake().verified_stmt("DESC TABLE test.table");
}
#[test]
fn parse_explain_table() {
match snowflake().verified_stmt("EXPLAIN TABLE test_identifier") {
Statement::ExplainTable {
describe_alias,
hive_format,
has_table_keyword,
table_name,
} => {
assert_eq!(describe_alias, DescribeAlias::Explain);
assert_eq!(hive_format, None);
assert_eq!(has_table_keyword, true);
assert_eq!("test_identifier", table_name.to_string());
}
_ => panic!("Unexpected Statement, must be ExplainTable"),
}
}