MCPcopy
hub / github.com/uber/aresdb / lookupSQLExpr

Method lookupSQLExpr

query/sql/sql_parser.go:1934–1944  ·  view source on GitHub ↗

lookupSQLExpr is used by groupBy, orderBy, having clause whose sql expression is select column alias. It returns the select column alias and sql expresion.

(s2aCtx *SQL2AqlContext, mapKey int, str string)

Source from the content-addressed store, hash-verified

1932// lookupSQLExpr is used by groupBy, orderBy, having clause whose sql expression is select column alias.
1933// It returns the select column alias and sql expresion.
1934func (v *ASTBuilder) lookupSQLExpr(s2aCtx *SQL2AqlContext, mapKey int, str string) (alias, sqlExpr string) {
1935 for _, measure := range s2aCtx.MapMeasures[mapKey] {
1936 if len(measure.Alias) > 0 && strings.Compare(measure.Alias, str) == 0 {
1937 alias = str
1938 sqlExpr = measure.Expr
1939 return
1940 }
1941 }
1942 sqlExpr = str
1943 return
1944}
1945
1946// check path from expression node to leaf node has logicalBinaryOperator OR
1947func (v *ASTBuilder) hasORInPath(node *antlr.BaseParserRuleContext) tree.LogicalBinaryExpType {

Callers 2

VisitSortItemMethod · 0.95

Calls 1

CompareMethod · 0.80

Tested by

no test coverage detected