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)
| 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. |
| 1934 | func (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 |
| 1947 | func (v *ASTBuilder) hasORInPath(node *antlr.BaseParserRuleContext) tree.LogicalBinaryExpType { |
no test coverage detected