(pos Pos)
| 840 | } |
| 841 | |
| 842 | func (p *Parser) tryParseClusterClause(pos Pos) (*ClusterClause, error) { |
| 843 | if !p.tryConsumeKeywords(KeywordOn) { |
| 844 | return nil, nil // nolint |
| 845 | } |
| 846 | if err := p.expectKeyword(KeywordCluster); err != nil { |
| 847 | return nil, err |
| 848 | } |
| 849 | |
| 850 | var expr Expr |
| 851 | var err error |
| 852 | switch { |
| 853 | case p.matchTokenKind(TokenKindIdent): |
| 854 | expr, err = p.parseIdent() |
| 855 | case p.matchTokenKind(TokenKindString): |
| 856 | expr, err = p.parseString(p.Pos()) |
| 857 | default: |
| 858 | return nil, fmt.Errorf("unexpected token: %q, expected <IDENT> or <STRING>", p.last().String) |
| 859 | } |
| 860 | if err != nil { |
| 861 | return nil, err |
| 862 | } |
| 863 | return &ClusterClause{ |
| 864 | OnPos: pos, |
| 865 | Expr: expr, |
| 866 | }, nil |
| 867 | } |
| 868 | |
| 869 | func (p *Parser) tryParsePartitionByClause(pos Pos) (*PartitionByClause, error) { |
| 870 | if !p.tryConsumeKeywords(KeywordPartition) { |
no test coverage detected