Skip to content

Commit 9249aa3

Browse files
committed
Code review comments
1 parent a5edbb7 commit 9249aa3

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/ast/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4413,7 +4413,7 @@ impl fmt::Display for Statement {
44134413
let keyword = match &db_name_keyword {
44144414
Some(Keyword::FROM) => "FROM",
44154415
Some(Keyword::IN) => "IN",
4416-
_ => "", // unexpected
4416+
_ => unreachable!(),
44174417
};
44184418
write!(f, " {} {db_name}", keyword)?;
44194419
}
@@ -4422,17 +4422,17 @@ impl fmt::Display for Statement {
44224422
}
44234423
Ok(())
44244424
}
4425-
Statement::ShowViews {
4426-
db_name_keyword,
4427-
db_name,
4428-
filter
4425+
Statement::ShowViews {
4426+
db_name_keyword,
4427+
db_name,
4428+
filter,
44294429
} => {
44304430
write!(f, "SHOW VIEWS")?;
44314431
if let Some(db_name) = db_name {
44324432
let keyword = match &db_name_keyword {
44334433
Some(Keyword::FROM) => "FROM",
44344434
Some(Keyword::IN) => "IN",
4435-
_ => "", // unexpected
4435+
_ => unreachable!(),
44364436
};
44374437
write!(f, " {} {db_name}", keyword)?;
44384438
}

tests/sqlparser_hive.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -536,16 +536,16 @@ fn parse_use() {
536536

537537
#[test]
538538
fn test_show() {
539-
hive().verified_stmt("SHOW DATABASES");
540-
hive().verified_stmt("SHOW DATABASES LIKE '%abc'");
541-
hive().verified_stmt("SHOW SCHEMAS");
542-
hive().verified_stmt("SHOW SCHEMAS LIKE '%abc'");
543-
hive().verified_stmt("SHOW TABLES");
544-
hive().verified_stmt("SHOW TABLES IN db1");
545-
hive().verified_stmt("SHOW TABLES IN db1 'abc'");
546-
hive().verified_stmt("SHOW VIEWS");
547-
hive().verified_stmt("SHOW VIEWS IN db1");
548-
hive().verified_stmt("SHOW VIEWS IN db1 'abc'");
539+
hive_and_generic().verified_stmt("SHOW DATABASES");
540+
hive_and_generic().verified_stmt("SHOW DATABASES LIKE '%abc'");
541+
hive_and_generic().verified_stmt("SHOW SCHEMAS");
542+
hive_and_generic().verified_stmt("SHOW SCHEMAS LIKE '%abc'");
543+
hive_and_generic().verified_stmt("SHOW TABLES");
544+
hive_and_generic().verified_stmt("SHOW TABLES IN db1");
545+
hive_and_generic().verified_stmt("SHOW TABLES IN db1 'abc'");
546+
hive_and_generic().verified_stmt("SHOW VIEWS");
547+
hive_and_generic().verified_stmt("SHOW VIEWS IN db1");
548+
hive_and_generic().verified_stmt("SHOW VIEWS IN db1 'abc'");
549549
}
550550

551551
fn hive() -> TestedDialects {

0 commit comments

Comments
 (0)