moshap-firebolt commented on code in PR #2772:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2772#discussion_r4428352106
##########
src/parser/mod.rs:
##########
@@ -1620,12 +1620,16 @@ impl<'a> Parser<'a> {
Keyword::TRY_CAST =>
Ok(Some(self.parse_cast_expr(CastKind::TryCast)?)),
Keyword::SAFE_CAST =>
Ok(Some(self.parse_cast_expr(CastKind::SafeCast)?)),
Keyword::EXISTS
- // Support parsing Databricks has a function named `exists`.
- if !dialect_of!(self is DatabricksDialect)
+ // A query after the parenthesis is still the EXISTS predicate.
+ if !self.dialect.supports_exists_function()
|| matches!(
self.peek_nth_token_ref(1).token,
Token::Word(Word {
- keyword: Keyword::SELECT | Keyword::WITH,
+ keyword: Keyword::SELECT
+ | Keyword::WITH
+ | Keyword::TABLE
+ | Keyword::VALUES
+ | Keyword::FROM,
Review Comment:
Good catch - both done!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]