resolveTypes walks all expresison ASTs and resolves data types bottom up. In addition it also translates enum strings and rewrites their predicates.
()
| 1175 | // resolveTypes walks all expresison ASTs and resolves data types bottom up. |
| 1176 | // In addition it also translates enum strings and rewrites their predicates. |
| 1177 | func (qc *AQLQueryContext) resolveTypes() { |
| 1178 | // Join conditions. |
| 1179 | for i, join := range qc.Query.Joins { |
| 1180 | for j, cond := range join.ConditionsParsed { |
| 1181 | join.ConditionsParsed[j] = expr.Rewrite(qc, cond) |
| 1182 | if qc.Error != nil { |
| 1183 | return |
| 1184 | } |
| 1185 | } |
| 1186 | qc.Query.Joins[i] = join |
| 1187 | } |
| 1188 | |
| 1189 | // Dimensions. |
| 1190 | for i, dim := range qc.Query.Dimensions { |
| 1191 | dim.ExprParsed = expr.Rewrite(qc, dim.ExprParsed) |
| 1192 | if qc.Error != nil { |
| 1193 | return |
| 1194 | } |
| 1195 | qc.Query.Dimensions[i] = dim |
| 1196 | } |
| 1197 | |
| 1198 | // Measures. |
| 1199 | for i, measure := range qc.Query.Measures { |
| 1200 | measure.ExprParsed = expr.Rewrite(qc, measure.ExprParsed) |
| 1201 | if qc.Error != nil { |
| 1202 | return |
| 1203 | } |
| 1204 | for j, filter := range measure.FiltersParsed { |
| 1205 | measure.FiltersParsed[j] = expr.Rewrite(qc, filter) |
| 1206 | if qc.Error != nil { |
| 1207 | return |
| 1208 | } |
| 1209 | } |
| 1210 | measure.FiltersParsed = normalizeAndFilters(measure.FiltersParsed) |
| 1211 | qc.Query.Measures[i] = measure |
| 1212 | } |
| 1213 | |
| 1214 | // Filters. |
| 1215 | for i, filter := range qc.Query.FiltersParsed { |
| 1216 | qc.Query.FiltersParsed[i] = expr.Rewrite(qc, filter) |
| 1217 | if qc.Error != nil { |
| 1218 | return |
| 1219 | } |
| 1220 | } |
| 1221 | qc.Query.FiltersParsed = normalizeAndFilters(qc.Query.FiltersParsed) |
| 1222 | } |
| 1223 | |
| 1224 | // extractFitler processes the specified query level filter and matches it |
| 1225 | // against the following formats: |
no test coverage detected