skipClickHouseWithFillTail consumes the optional FROM / TO / STEP arguments of a ClickHouse "ORDER BY expr WITH FILL" modifier. Each argument is a single expression (possibly an INTERVAL). The tail ends at the next comma (more ORDER BY items), next clause keyword, ';', or EOF.
()
| 587 | // single expression (possibly an INTERVAL). The tail ends at the next comma |
| 588 | // (more ORDER BY items), next clause keyword, ';', or EOF. |
| 589 | func (p *Parser) skipClickHouseWithFillTail() { |
| 590 | for { |
| 591 | val := strings.ToUpper(p.currentToken.Token.Value) |
| 592 | if val != "FROM" && val != "TO" && val != "STEP" { |
| 593 | return |
| 594 | } |
| 595 | p.advance() // FROM / TO / STEP |
| 596 | // Consume one expression; ignore parse errors so unusual forms |
| 597 | // (INTERVAL '1 day', expressions with function calls, etc.) don't |
| 598 | // surface as parser errors for this permissive skip. |
| 599 | if _, err := p.parseExpression(); err != nil { |
| 600 | return |
| 601 | } |
| 602 | } |
| 603 | } |
| 604 | |
| 605 | // parseLimitOffsetClause parses optional LIMIT and/or OFFSET clauses. |
| 606 | // Supports standard "LIMIT n OFFSET m", MySQL "LIMIT offset, count", and |
no test coverage detected