Skip to content

Commit f81d917

Browse files
committed
Code review comments
1 parent cdfd75f commit f81d917

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/dialect/snowflake.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,11 @@ impl Dialect for SnowflakeDialect {
318318
}
319319

320320
// `FETCH` can be considered an alias as long as it's not followed by `FIRST`` or `NEXT`
321-
// which would give it a different meanings, for example: `SELECT 1 FETCH FIRST 10 ROWS` - not an alias
322-
Keyword::FETCH if parser.peek_one_of_keywords(&[Keyword::FIRST, Keyword::NEXT]).is_some() =>
321+
// which would give it a different meanings, for example:
322+
// `SELECT 1 FETCH FIRST 10 ROWS` - not an alias
323+
// `SELECT 1 FETCH 10` - not an alias
324+
Keyword::FETCH if parser.peek_one_of_keywords(&[Keyword::FIRST, Keyword::NEXT]).is_some()
325+
|| matches!(parser.peek_token().token, Token::Number(_, _)) =>
323326
{
324327
false
325328
}
@@ -367,8 +370,9 @@ impl Dialect for SnowflakeDialect {
367370
// `SELECT * FROM tbl FETCH FIRST 10 ROWS` - not an alias
368371
// `SELECT * FROM tbl FETCH 10` - not an alias
369372
Keyword::FETCH
370-
if parser.peek_keyword(Keyword::FIRST)
371-
|| parser.peek_keyword(Keyword::NEXT)
373+
if parser
374+
.peek_one_of_keywords(&[Keyword::FIRST, Keyword::NEXT])
375+
.is_some()
372376
|| matches!(parser.peek_token().token, Token::Number(_, _)) =>
373377
{
374378
false

0 commit comments

Comments
 (0)