yoavcloud commented on code in PR #1487: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1487#discussion_r1821920445
########## src/ast/mod.rs: ########## @@ -4376,7 +4410,31 @@ impl fmt::Display for Statement { full = if *full { "FULL " } else { "" }, )?; if let Some(db_name) = db_name { - write!(f, " FROM {db_name}")?; + let keyword = match &db_name_keyword { + Some(Keyword::FROM) => "FROM", + Some(Keyword::IN) => "IN", + _ => "", // unexpected Review Comment: Fixed ########## src/ast/mod.rs: ########## @@ -4376,7 +4410,31 @@ impl fmt::Display for Statement { full = if *full { "FULL " } else { "" }, )?; if let Some(db_name) = db_name { - write!(f, " FROM {db_name}")?; + let keyword = match &db_name_keyword { + Some(Keyword::FROM) => "FROM", + Some(Keyword::IN) => "IN", + _ => "", // unexpected + }; + write!(f, " {} {db_name}", keyword)?; + } + if let Some(filter) = filter { + write!(f, " {filter}")?; + } + Ok(()) + } + Statement::ShowViews { + db_name_keyword, + db_name, + filter + } => { + write!(f, "SHOW VIEWS")?; + if let Some(db_name) = db_name { + let keyword = match &db_name_keyword { + Some(Keyword::FROM) => "FROM", + Some(Keyword::IN) => "IN", + _ => "", // unexpected Review Comment: Fixed ########## tests/sqlparser_hive.rs: ########## @@ -534,6 +534,20 @@ fn parse_use() { ); } +#[test] +fn test_show() { + hive().verified_stmt("SHOW DATABASES"); Review Comment: Fixed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org