MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / skipClickHouseWithFillTail

Method skipClickHouseWithFillTail

pkg/sql/parser/select_clauses.go:589–603  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

587// single expression (possibly an INTERVAL). The tail ends at the next comma
588// (more ORDER BY items), next clause keyword, ';', or EOF.
589func (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

Callers 1

parseOrderByClauseMethod · 0.95

Calls 2

advanceMethod · 0.95
parseExpressionMethod · 0.95

Tested by

no test coverage detected