(pos Pos)
| 1205 | } |
| 1206 | |
| 1207 | func (p *Parser) tryParseSampleByClause(pos Pos) (*SampleByClause, error) { |
| 1208 | if !p.tryConsumeKeywords(KeywordSample) { |
| 1209 | return nil, nil // nolint |
| 1210 | } |
| 1211 | |
| 1212 | if err := p.expectKeyword(KeywordBy); err != nil { |
| 1213 | return nil, err |
| 1214 | } |
| 1215 | |
| 1216 | // parse sample by expr |
| 1217 | columnExpr, err := p.parseExpr(p.Pos()) |
| 1218 | if err != nil { |
| 1219 | return nil, err |
| 1220 | } |
| 1221 | return &SampleByClause{ |
| 1222 | SamplePos: pos, |
| 1223 | Expr: columnExpr, |
| 1224 | }, nil |
| 1225 | } |
| 1226 | |
| 1227 | func (p *Parser) tryParseSettingsClause(pos Pos) (*SettingsClause, error) { |
| 1228 | if !p.tryConsumeKeywords(KeywordSettings) { |
no test coverage detected