mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-12-23 11:12:51 +00:00
Support: Databricks and generic: fix for values as table name (#1278)
This commit is contained in:
parent
54184460b5
commit
9d15f7e9a9
3 changed files with 88 additions and 2 deletions
|
|
@ -8594,8 +8594,19 @@ impl<'a> Parser<'a> {
|
|||
self.expected("joined table", self.peek_token())
|
||||
}
|
||||
} else if dialect_of!(self is SnowflakeDialect | DatabricksDialect | GenericDialect)
|
||||
&& self.parse_keyword(Keyword::VALUES)
|
||||
&& matches!(
|
||||
self.peek_tokens(),
|
||||
[
|
||||
Token::Word(Word {
|
||||
keyword: Keyword::VALUES,
|
||||
..
|
||||
}),
|
||||
Token::LParen
|
||||
]
|
||||
)
|
||||
{
|
||||
self.expect_keyword(Keyword::VALUES)?;
|
||||
|
||||
// Snowflake and Databricks allow syntax like below:
|
||||
// SELECT * FROM VALUES (1, 'a'), (2, 'b') AS t (col1, col2)
|
||||
// where there are no parentheses around the VALUES clause.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue