MCPcopy Create free account
hub / github.com/AfterShip/clickhouse-sql-parser / tryParseTTLClause

Method tryParseTTLClause

parser/parser_table.go:1103–1118  ·  view source on GitHub ↗
(pos Pos, allowMultiValues bool)

Source from the content-addressed store, hash-verified

1101}
1102
1103func (p *Parser) tryParseTTLClause(pos Pos, allowMultiValues bool) (*TTLClause, error) {
1104 if !p.tryConsumeKeywords(KeywordTtl) {
1105 return nil, nil // nolint
1106 }
1107 ttlExprList := &TTLClause{TTLPos: pos, ListEnd: pos}
1108 // accept the TTL keyword
1109 items, err := p.parseTTLClause(pos, allowMultiValues)
1110 if err != nil {
1111 return nil, err
1112 }
1113 if len(items) > 0 {
1114 ttlExprList.ListEnd = items[len(items)-1].End()
1115 }
1116 ttlExprList.Items = items
1117 return ttlExprList, nil
1118}
1119
1120// parseTTLClause parses the TTL clause.
1121// allowMultiValues is used to determine whether to allow multiple TTL values.

Callers 2

parseTableColumnExprMethod · 0.95
parseEngineExprMethod · 0.95

Calls 3

tryConsumeKeywordsMethod · 0.95
parseTTLClauseMethod · 0.95
EndMethod · 0.65

Tested by

no test coverage detected