Add support for SHOW DATABASES/SCHEMAS/TABLES/VIEWS in Hive (#1487)

This commit is contained in:
Yoav Cohen 2024-11-03 14:07:06 +01:00 committed by GitHub
parent 8de3cb0074
commit e2197eeca9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 157 additions and 7 deletions

View file

@ -329,6 +329,7 @@ fn parse_show_tables() {
Statement::ShowTables {
extended: false,
full: false,
clause: None,
db_name: None,
filter: None,
}
@ -338,6 +339,7 @@ fn parse_show_tables() {
Statement::ShowTables {
extended: false,
full: false,
clause: Some(ShowClause::FROM),
db_name: Some(Ident::new("mydb")),
filter: None,
}
@ -347,6 +349,7 @@ fn parse_show_tables() {
Statement::ShowTables {
extended: true,
full: false,
clause: None,
db_name: None,
filter: None,
}
@ -356,6 +359,7 @@ fn parse_show_tables() {
Statement::ShowTables {
extended: false,
full: true,
clause: None,
db_name: None,
filter: None,
}
@ -365,6 +369,7 @@ fn parse_show_tables() {
Statement::ShowTables {
extended: false,
full: false,
clause: None,
db_name: None,
filter: Some(ShowStatementFilter::Like("pattern".into())),
}
@ -374,13 +379,15 @@ fn parse_show_tables() {
Statement::ShowTables {
extended: false,
full: false,
clause: None,
db_name: None,
filter: Some(ShowStatementFilter::Where(
mysql_and_generic().verified_expr("1 = 2")
)),
}
);
mysql_and_generic().one_statement_parses_to("SHOW TABLES IN mydb", "SHOW TABLES FROM mydb");
mysql_and_generic().verified_stmt("SHOW TABLES IN mydb");
mysql_and_generic().verified_stmt("SHOW TABLES FROM mydb");
}
#[test]