yoavcloud commented on code in PR #1501: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1501#discussion_r1835316915
########## src/parser/mod.rs: ########## @@ -9685,58 +9711,95 @@ impl<'a> Parser<'a> { extended: bool, full: bool, ) -> Result<Statement, ParserError> { - self.expect_one_of_keywords(&[Keyword::FROM, Keyword::IN])?; - let object_name = self.parse_object_name(false)?; - let table_name = match self.parse_one_of_keywords(&[Keyword::FROM, Keyword::IN]) { - Some(_) => { - let db_name = vec![self.parse_identifier(false)?]; - let ObjectName(table_name) = object_name; - let object_name = db_name.into_iter().chain(table_name).collect(); - ObjectName(object_name) - } - None => object_name, - }; - let filter = self.parse_show_statement_filter()?; + let filter; + let filter_position; + let show_in; + if self.dialect.supports_show_like_before_in() { + filter = self.parse_show_statement_filter()?; + filter_position = ShowStatementFilterPosition::InTheMiddle; + show_in = self.parse_show_opt_in()?; + } else { + show_in = self.parse_show_opt_in()?; + filter = self.parse_show_statement_filter()?; + filter_position = ShowStatementFilterPosition::AtTheEnd; + } Ok(Statement::ShowColumns { extended, full, - table_name, + show_in, filter, + filter_position, }) } - pub fn parse_show_tables( + fn parse_show_tables( &mut self, + terse: bool, extended: bool, full: bool, + external: bool, ) -> Result<Statement, ParserError> { - let (clause, db_name) = match self.parse_one_of_keywords(&[Keyword::FROM, Keyword::IN]) { - Some(Keyword::FROM) => (Some(ShowClause::FROM), Some(self.parse_identifier(false)?)), - Some(Keyword::IN) => (Some(ShowClause::IN), Some(self.parse_identifier(false)?)), - _ => (None, None), - }; - let filter = self.parse_show_statement_filter()?; + let history = !external && self.parse_keyword(Keyword::HISTORY); + let filter; + let show_in; + let filter_position; + if self.dialect.supports_show_like_before_in() { + filter = self.parse_show_statement_filter()?; + //YOAV: here we have a problem, the hint is DB-dependent (table in a schemas or some other object) Review Comment: Oops... 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