VisitSubqueryRelation visits the node
(ctx *antlrgen.SubqueryRelationContext)
| 925 | |
| 926 | // VisitSubqueryRelation visits the node |
| 927 | func (v *ASTBuilder) VisitSubqueryRelation(ctx *antlrgen.SubqueryRelationContext) interface{} { |
| 928 | v.Logger.Debugf("VisitSubqueryRelation: %s", ctx.GetText()) |
| 929 | |
| 930 | level, levelWith, levelQuery := v.getCtxLevels(v.SQL2AqlCtx) |
| 931 | // mapKey is the mapKey of parent query |
| 932 | mapKey := v.SQL2AqlCtx.mapKey |
| 933 | last := len(v.SQL2AqlCtx.MapJoinTables[v.SQL2AqlCtx.mapKey]) - 1 |
| 934 | |
| 935 | v.setCtxLevels(v.SQL2AqlCtx, level-1, levelWith, levelQuery+1) |
| 936 | // the index in v.SQL2AqlCtx.mapKey is the index of the aliasedRelation in parent from clause |
| 937 | v.SQL2AqlCtx.mapKey = v.generateKey(levelQuery+1, typeSubQuery, last) |
| 938 | v.SQL2AqlCtx.MapQueryIdentifier[v.SQL2AqlCtx.mapKey] = v.SQL2AqlCtx.MapJoinTables[mapKey][last].Alias |
| 939 | v.addQIdentifier(v.SQL2AqlCtx, v.SQL2AqlCtx.MapJoinTables[mapKey][last].Alias, v.SQL2AqlCtx.mapKey) |
| 940 | v.SQL2AqlCtx.MapMeasures[v.SQL2AqlCtx.mapKey] = make([]queryCom.Measure, 0, defaultSliceCap) |
| 941 | v.SQL2AqlCtx.MapDimensions[v.SQL2AqlCtx.mapKey] = make([]queryCom.Dimension, 0, defaultSliceCap) |
| 942 | v.SQL2AqlCtx.MapJoinTables[v.SQL2AqlCtx.mapKey] = make([]queryCom.Join, 0, defaultSliceCap) |
| 943 | v.SQL2AqlCtx.MapRowFilters[v.SQL2AqlCtx.mapKey] = make([]string, 0, defaultSliceCap) |
| 944 | v.SQL2AqlCtx.MapOrderBy[v.SQL2AqlCtx.mapKey] = make([]queryCom.SortField, 0, defaultSliceCap) |
| 945 | |
| 946 | query, _ := v.VisitQuery(ctx.Query().(*antlrgen.QueryContext)).(*tree.Query) |
| 947 | tableSubquery := tree.NewTableSubquery(v.getLocation(ctx), query) |
| 948 | tableSubquery.SetValue(fmt.Sprintf("TableSubquery: (%s)", v.getText(ctx.BaseParserRuleContext))) |
| 949 | |
| 950 | return tableSubquery |
| 951 | } |
| 952 | |
| 953 | // ********************* primary expressions ********************** |
| 954 |
nothing calls this directly
no test coverage detected