MCPcopy Index your code
hub / github.com/uber/aresdb / hasORInPath

Method hasORInPath

query/sql/sql_parser.go:1947–1963  ·  view source on GitHub ↗

check path from expression node to leaf node has logicalBinaryOperator OR

(node *antlr.BaseParserRuleContext)

Source from the content-addressed store, hash-verified

1945
1946// check path from expression node to leaf node has logicalBinaryOperator OR
1947func (v *ASTBuilder) hasORInPath(node *antlr.BaseParserRuleContext) tree.LogicalBinaryExpType {
1948 parent := node.GetParent()
1949 op := tree.NOOP
1950 for parent != nil {
1951 switch p := parent.(type) {
1952 case antlrgen.IExpressionContext:
1953 return op
1954 case *antlrgen.LogicalBinaryContext:
1955 if p.GetOperator() != nil && v.getLogicalBinaryOperator(p.GetOperator().GetTokenType()) == tree.OR {
1956 return tree.OR
1957 }
1958 op = tree.AND
1959 }
1960 parent = parent.GetParent()
1961 }
1962 return op
1963}
1964
1965// Parse parses input sql
1966func Parse(sql string, logger common.Logger) (aql *queryCom.AQLQuery, err error) {

Callers 1

VisitFunctionCallMethod · 0.95

Calls 2

GetOperatorMethod · 0.45

Tested by

no test coverage detected