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

Method parseTTLClause

parser/parser_table.go:1122–1137  ·  view source on GitHub ↗

parseTTLClause parses the TTL clause. allowMultiValues is used to determine whether to allow multiple TTL values.

(pos Pos, allowMultiValues bool)

Source from the content-addressed store, hash-verified

1120// parseTTLClause parses the TTL clause.
1121// allowMultiValues is used to determine whether to allow multiple TTL values.
1122func (p *Parser) parseTTLClause(pos Pos, allowMultiValues bool) ([]*TTLExpr, error) {
1123 items := make([]*TTLExpr, 0)
1124 expr, err := p.parseTTLExpr(pos)
1125 if err != nil {
1126 return nil, err
1127 }
1128 items = append(items, expr)
1129 for allowMultiValues && !p.lexer.isEOF() && p.tryConsumeTokenKind(TokenKindComma) != nil {
1130 expr, err = p.parseTTLExpr(pos)
1131 if err != nil {
1132 return nil, err
1133 }
1134 items = append(items, expr)
1135 }
1136 return items, nil
1137}
1138
1139func (p *Parser) tryParseTTLPolicy(pos Pos) (*TTLPolicy, error) {
1140 var rule *TTLPolicyRule

Callers 2

parseAlterTableModifyMethod · 0.95
tryParseTTLClauseMethod · 0.95

Calls 3

parseTTLExprMethod · 0.95
tryConsumeTokenKindMethod · 0.95
isEOFMethod · 0.80

Tested by

no test coverage detected