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

Method parseJoinOp

parser/parser_query.go:171–247  ·  view source on GitHub ↗
(_ Pos)

Source from the content-addressed store, hash-verified

169}
170
171func (p *Parser) parseJoinOp(_ Pos) []string {
172 var modifiers []string
173 switch {
174 case p.tryConsumeKeywords(KeywordCross): // cross join
175 modifiers = append(modifiers, KeywordCross)
176 case p.matchKeyword(KeywordAny), p.matchKeyword(KeywordAll):
177 modifiers = append(modifiers, p.last().String)
178 _ = p.lexer.consumeToken()
179 if p.matchKeyword(KeywordFull) {
180 modifiers = append(modifiers, p.last().String)
181 _ = p.lexer.consumeToken()
182 }
183 if p.matchKeyword(KeywordLeft) || p.matchKeyword(KeywordRight) || p.matchKeyword(KeywordInner) || p.matchKeyword(KeywordOuter) {
184 modifiers = append(modifiers, p.last().String)
185 _ = p.lexer.consumeToken()
186 }
187 case p.matchKeyword(KeywordSemi), p.matchKeyword(KeywordAsof):
188 modifiers = append(modifiers, p.last().String)
189 _ = p.lexer.consumeToken()
190 if p.matchKeyword(KeywordLeft) || p.matchKeyword(KeywordRight) {
191 modifiers = append(modifiers, p.last().String)
192 _ = p.lexer.consumeToken()
193 }
194 if p.matchKeyword(KeywordOuter) {
195 modifiers = append(modifiers, p.last().String)
196 _ = p.lexer.consumeToken()
197 }
198 case p.matchKeyword(KeywordInner):
199 modifiers = append(modifiers, p.last().String)
200 _ = p.lexer.consumeToken()
201 if p.matchKeyword(KeywordAll) || p.matchKeyword(KeywordAny) || p.matchKeyword(KeywordAsof) || p.matchKeyword(KeywordArray) {
202 modifiers = append(modifiers, p.last().String)
203 _ = p.lexer.consumeToken()
204 }
205 case p.matchKeyword(KeywordLeft):
206 modifiers = append(modifiers, p.last().String)
207 _ = p.lexer.consumeToken()
208 if p.matchKeyword(KeywordOuter) {
209 modifiers = append(modifiers, p.last().String)
210 _ = p.lexer.consumeToken()
211 }
212 if p.matchKeyword(KeywordSemi) || p.matchKeyword(KeywordAnti) ||
213 p.matchKeyword(KeywordAny) || p.matchKeyword(KeywordAll) ||
214 p.matchKeyword(KeywordAsof) || p.matchKeyword(KeywordArray) {
215 modifiers = append(modifiers, p.last().String)
216 _ = p.lexer.consumeToken()
217 }
218 case p.matchKeyword(KeywordRight):
219 modifiers = append(modifiers, p.last().String)
220 _ = p.lexer.consumeToken()
221 if p.matchKeyword(KeywordOuter) {
222 modifiers = append(modifiers, p.last().String)
223 _ = p.lexer.consumeToken()
224 }
225 if p.matchKeyword(KeywordSemi) || p.matchKeyword(KeywordAnti) ||
226 p.matchKeyword(KeywordAny) || p.matchKeyword(KeywordAll) ||
227 p.matchKeyword(KeywordAsof) {
228 modifiers = append(modifiers, p.last().String)

Callers 1

parseJoinRightExprMethod · 0.95

Calls 4

tryConsumeKeywordsMethod · 0.95
matchKeywordMethod · 0.95
lastMethod · 0.95
consumeTokenMethod · 0.80

Tested by

no test coverage detected