isSnowflakeTimeTravelStart returns true when the current token begins an AT / BEFORE / CHANGES time-travel clause in the Snowflake dialect.
()
| 359 | // isSnowflakeTimeTravelStart returns true when the current token begins an |
| 360 | // AT / BEFORE / CHANGES time-travel clause in the Snowflake dialect. |
| 361 | func (p *Parser) isSnowflakeTimeTravelStart() bool { |
| 362 | if p.dialect != string(keywords.DialectSnowflake) { |
| 363 | return false |
| 364 | } |
| 365 | // BEFORE / CHANGES: plain identifier or keyword |
| 366 | val := strings.ToUpper(p.currentToken.Token.Value) |
| 367 | if val == "BEFORE" || val == "CHANGES" { |
| 368 | // Must be followed by '(' to disambiguate from other uses. |
| 369 | return p.peekToken().Token.Type == models.TokenTypeLParen |
| 370 | } |
| 371 | // AT: either TokenTypeAt (@) or an identifier-token "AT" followed by '('. |
| 372 | if val == "AT" && p.peekToken().Token.Type == models.TokenTypeLParen { |
| 373 | return true |
| 374 | } |
| 375 | return false |
| 376 | } |
| 377 | |
| 378 | // isSampleKeyword returns true if the current token is SAMPLE or TABLESAMPLE |
| 379 | // followed by '(' or a sampling-method keyword, indicating a sampling clause |
no test coverage detected